Cant replicate Regex101 output in StudioX

Cant seem to replicate Regex101 output in studio.


Output is empty in Studio.

Is there a resource that can help translate from regex 101 to Studiox. This is a very common issue for me.

Hi @rpadev77

how are you implementing this regex? if your text is multiline, make sure to add the appropiate RegexOption like this

image

System.Text.RegularExpressions.Regex.Match(strInput, "yourPattern" , RegexOptions.Multiline).Value

Regards!

I didnt know about this. Good to know

No still didnt work

Hi,

It might be linebreak matter. Can you try to use \r?\n\r?\n instead of \s\s

Regards

Please give a try with this regex

System.Text.RegularExpressions.Regex.Match(strInput, "(?<=\n)\d+\s+(\w+\s+\w+)", RegexOptions.Multiline).Value

Regards

That works! So is the train of thought to use \r?\n instead of \s i guess?

Yes, regex101 uses LF : /n as linebreak. But windows linebreak is CRLF : \r\n . So, \r?\n works in both case.

1 Like

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