Extraction with Regex

Hi, I am trying to extract “1676788” from “PO number SS-1676788-KKPHF-OP”.
with Regex Matches activity using the pattern “(PO number [^ ]*-([0-9]+)-)”.

When I tested in Regex editor, it successfully extracted “1676788”. But when I run it in UIPath, the extracted result is “PO number SO-1676788-”.

I would be grateful if you could advise me.

Hi,

Hope the following expression helps you.

strNumber = System.Text.RegularExpressions.Regex.Match(strData,"(?<=PO number \S*-)\d+(?=-)").Value

Regards,

Hi Yoichi,
Thank you very much! It works like a charm. Exactly what I needed. Cheers!!

1 Like

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