Help With Regex VbNewline Validation

Could anyone explain me why this regex match returns as False?


The test on RegExt of the expression did pass:


Seems to be a problem with the VbNewline, when i remove it, the match returns True, but i need to validate this newline…

Hi @MaysonLedur,

Kindly try Environment.NewLine function instead pf vbNewLine.

Kind Regards.

I dit also try this, same result, unfortunaly :frowning:


Can you enable Multiline.

“Regex.IsMatch(Str, Regx, RegexOptions.Multiline)”

Worth a try.

Hopefully that helps :blush:




Not yet =(

Tough one hey :thinking:

Try the following in this order.
Try removing the “$” sign.
Try adding a “+” to [\n\r].
Try removing the ^

Keep Multiline on.

If those don’t work, run in debug mode then use the immediate panel to keep testing/trying. Or maybe reduce the Str to one line and build up the complexity slowly to find the problem.

1 Like

The “+” after the “[\n\r]” did the trick! Thank you my friend, have a nice one!


1 Like

Glad I could help :blush:

Good luck with the rest of your project.

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