Hello I just need help to get specific text from email body using Regex on Studio X. I need the PO number that usually starts with 450***** so that i can open in SAP and create internal ticket using studio x

Hello I just need help to get specific text from email body using Regex on Studio X. I need the PO number that usually starts with 450***** so that i can open in SAP and create internal ticket using studio x

Sample email body
"Hi Karen,
4506792481 – order is on hold as FTQ-2473824 is standard SKU but PO is Co-term.
Please provide revised PO.

Yvonne Toh

Order Management

Fortinet (S) Pte Ltd

1 Like

Hi,

How about the following sample?

regex pattern

450\d+

NewBlankTask20231026-1.zip (50.0 KB)

Regards,

1 Like

Hi @Lolong_Alvin

Inupt= "Hi Karen,
        4506792481 – order is on hold as FTQ-2473824 is standard SKU but PO is Co-term.
        Please provide revised PO.

        Yvonne Toh

        Order Management

        Fortinet (S) Pte Ltd"

Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=\n\s*)\d+").Value 

Hope it helps!!

1 Like

You can try something like this using assign activity

Stroutput = System.Text.RegularExpressions.Regex.Match(Strinput.ToString, β€œ450\d+”).Value.ToString

Explanation

Cheers @Lolong_Alvin

1 Like

This 450\d+ worked. Thank you :slight_smile:

1 Like

Hope it’s clarified
If yes

@Lolong_Alvin

450\d+ worked.
Thank you @Yoichi :slight_smile:

HI,

FYI, if PO number has fixed digits, the following may be better.

\b450\d{7}\b

(If PO number is always 10 digits)

Regards,

1 Like

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