Issue with regex match and expression

Hi All,

I am using get ocr text to retrieve number beside (customer po no .) in 4 th line and I am using a regular expression (?<=Customer P0 No. ).* which says it is a match in regex site (see picture ) but it is not giving any results in uipath and also I am using is match activity which returns false. Below is my expression

System.Text.RegularExpressions.Regex.Match(order,β€œ(?<=Customer P0 No. ).*”).value

Text:
Decon Utilities, a div. of Ph#: 1-416-293-7004 β€œNO?” NO- 90646839
90 Carlson Ct, Suite 800 Tax ID: Serv1ce Rendered From 06/20/2019
Brazil TR M9W 7K6 887201887RT0006 Service Rendered T0 05/21/2020
Customer P0 No. 21385229
Bill-To-Party Customer P0 Date 05/20/2020
OPERATING AS ENBRIDGE GAS DISTRIBUTION Sales Order NO. 70226489

please help me out here

@vboddu Can you please print Get OCR output by using write line or message box as your regex is absolutely correct

1 Like

ok I will do it

Below is new text from write line and the expression is matching entire line. what is regex exp for only number beside customer po ?

β€β€˜ο¬β€™Γ©cam 1mm
Information
Aecon Utilities, a div. of Ph#: 1β€”416-293β€”7004 Invofwe NO- 90646839
Aecon Construction Group Inc web: www.aecon.com IHVOlce Date 05/21/2020
20 Carlson Ct, Suite 800 Tax ID: Service Rendered From 06/20/2019
M9W 7K6 887201887RT0006 Service Rendered To 05/21/2020
Customer PO No. 21385229
Bill-To-Party Customer PO Date 05/20/2020
OPERATING AS ENBRIDGE GAS DISTRIBUTION Sales Order NO. 70226489
SNBRIDGE GAS INC ProjeCt/CSO NO’ales Order Date 06/20/2019


output.txt (516 Bytes)

Hi @vboddu

Here is the .xaml file which gives accurate output that you want.
Main.xaml (6.5 KB)
output.txt (516 Bytes)
image

Regex :-
image

Output :-
image

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

3 Likes

I missed +
Thanks Pratik.

Thanks Arpit. I was able to resolve it now based on text take from write line and changing regex exprssion

1 Like

Hi @vboddu

Mark as a solution and like it for the solution i provided for the same.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

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