Matches activity throws object reference error when using a regex pattern

Hi,

I’m using this Regex pattern to get only the secondSentece below.

(?<=firstSentence\n).*(?=\s+)


firstSentence
secondSentence
thirdSentence

Problem is that “Matches” activity is throwing the below error when it’s run.

Any idea to solve this?

Thanks in advance.

image

image

image

Hi,

Can you try the following?

(?<=firstSentence\r?\n).*(?=\s+)

Regards,

2 Likes

Hi @Jenni_K

That error message is essentially saying “Your Regex Pattern was unsuccesful”

Here is a screenshot of @Yoichi’s solution:
image

I also have a solution - which will work as long as its only three lines :slight_smile: :
Pattern:
(?<=\n).*\n
image

If you still need assistance provide an improved sample.

Hopefully this helps :blush:

If you want to learn Regex - check out my Regex Megapost

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.