Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k 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.5k 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.7k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...