Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in RPA by (12.8k points)

I have a very simple sequence that:

Reads a pdf with OCR, outputs as ReadPDF string variable

A Matches activity with a regex formula of "(?<=Order Number\n\n)\d{5}" that outputs an |Enumerable variable WorkOrder

And an Assign activity to put the result into a variable idOrder = WorkOrder(0).ToString

The Regex works in the test environment: https://regex101.com/r/dmYhAY/8

I am getting an error: Assign: Object reference not set to an instance of an object.

I've used the matches activity successfully many times before and I'm not sure why this isn't working. Is there anything I'm using in Regex, (like \n) that isn't allowed in UiPath's use of Regex or something?

1 Answer

0 votes
by (29.8k points)

Try using the following regex:

 (?<=Order Number[\n\r]+)\d{5}

the reason for the discrepancy you are facing is the fact that Uipath uses .Net regex, so for now testing your regex you should use sites that support .Net regex and then you should not have any problem bringing it to Uipath workflow

Related questions

0 votes
1 answer
asked Jul 13, 2019 in RPA by Abhishek_31 (12.8k points)
0 votes
1 answer
0 votes
1 answer
asked Nov 20, 2020 in RPA by dev_sk2311 (43.2k points)
0 votes
1 answer
0 votes
1 answer
asked May 22, 2020 in RPA by Sudhir_1997 (55.5k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...