Fetch value after : using regex

Hi guys
I have scenario where I want to scrape Fieldwork PO number from email body
I made below expression but as business confirm that there are alpha numeric value might be exist in Fieldwork PO number.I can scrape number only using below regex but how to include alpha numeric.
image

(?<=Fieldwork PO number:)\s\d+

Hi @Aleem_Khan ,

To detect alphanumeric characters, you have to use \w.
Could you give this a try?

(?<=Fieldwork PO number:)\s\w+

This works too →

image

System.Text.RegularExpressions.Regex.Match("Fieldwork PO number: 2LL329","(?<=Fieldwork PO number:\s?)\w+",System.Text.RegularExpressions.RegexOptions.IgnoreCase).Value

Kind Regards,
Ashwin A.K

@Aleem_Khan Try the below one

2 Likes

Hi @Aleem_Khan

You are very close :blush:

Try this:

(?<=Fieldwork PO number:\s*)[\dA-Z]+

Cheers

Steve

1 Like