I am unable to get a result from the following regex (System.Text.RegularExpressions.Regex.Match(PdfText, “Ans1\s:([^?.])Q2”).Groups(1).Value.Trim).
The value I am after is the phone number from the string below:
Q1 :- Phone number? Ans1
:021123456
Q2 :-
Any ideas what is going wrong please? The regex displays correctly when typed into regex101.com but once it is in UiPath it doesn’t. Is this something to do with multiple lines? The problem is that I can’t use \n as the value may appear on the same line as Ans1 in some instances.
The patterns above worked just fine in the regex tester (https://www.regextester.com/) but once in UiPath the results returned an empty value. Is it something to do with the value being across multiple lines?