0

I have this:

Something Something Something Something111
Something Something Something Something
Something Something Something Something222.
Something Something Something Something
Something Something Something Something333.

I need to start from Something111 and stop after the first occurence of "."

Right now i have this code:

(?<=Something111)((.|\n)*)\.

Which is returning all before the last "." so in this case all after "Something333"

But i need to stop after the first "." so in this case after "Something222"

So the returned text should be this:

Something Something Something Something111
Something Something Something Something
Something Something Something Something222.

I am working in UiPath Studio which uses VB.NET as language.

Toto
  • 89,455
  • 62
  • 89
  • 125

1 Answers1

0

If you also want to include what is before you don't need the positive lookbehind because if you use (?<=Something111) then that will not be part of the match.

Instead you could match from the start of the string ^ and match Something111 between word boundaries \b.

After that, match any char except a dot using a negated character class.

^.*\bSomething111\b[^.]*\.

Regex demo

The fourth bird
  • 154,723
  • 16
  • 55
  • 70