Since I am new to UI Path (or programming in general), perhaps this will be silly question, but I have spent enough time searching for an answer and I can’t find it.
Scenario A. I am using matches regex look after “(?<=[p|P]olicy [n|N]umber).*” to get a specific text from text document, output is saved as IEnumerable variable say matchWord1, and then producing output in to a message. This works fine, no problems.
Scenario B. Exactly same thing, however, this time Policy number is down in a next line. So for this I have the following regex “(?<=\b[p|P]olicy [n|N]umber\s)\S+.*” and as before I want to see it in a message box.
When I run it, message box gets highlighted ant the error is “Assign: Object reference not set to an instance of an object.”
In both scenarios
To get text in the message box I am typing variable from matches output like this: matchWord2(0).value
It does not show me any errors up until I run it.
Policy number can be made up of letters and numbers
Tested regex code in regexr.com as well as in UI path, the code seems to be correct.
I was thinking I need to initialize that matches output variable (FYI that’s another issue, could not successfully initialize, so I would appreciate help for that as well.), but even more confusing thing for me is why A scenario worked without initialising, and B would need to be initialize?
Thank you in advance!