Regex pattern help for the string

i want to write regex for following string

CUSTOMER INFO
10234 Jamie Lawson

Here is CUSTOMER INFO has space and i want the value below of that

i want expected results is 10234 Jamie Lawson

Hi @T_Y_Raju

(\d+\s+).*

image

Cheers!!

1 Like

Hi @T_Y_Raju

Please use the below regex:

Input="CUSTOMER INFO
10234 Jamie Lawson"

Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=[A-Za-z]+[\s\S]*?)(\d+.*)").Value

Regards

1 Like

@T_Y_Raju

Use this regex

(?<=CUSTOMER INFO\s*).*

If using regex activity select multiline in options

Cheers

digits also i need in the regex

@T_Y_Raju

How about this?

(\d+\s+).*

image

this expression will always take the below value

HI @T_Y_Raju

Please check the above flow i have implemented the wrokflow also

Regards

@T_Y_Raju

Isnt that what you need?

Cheers

yes

i also want to extract data between Deliver To and BILLING

Deliver To ABC
2345 IL Ave
Plaza. 301
chica

BILLING

Hi @T_Y_Raju

Input= "Deliver To ABC
2345 IL Ave
Plaza. 301
chica

BILLING"
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=Deliver To\s+)[\s\S]*?(?=\s+BILLING)").Value


Regards

1 Like

@T_Y_Raju

For that just use split

Str.Split({"Delivery To"},StringSplitOptions.None)(1).Split({"BILLING"},Stringsplitoptions.None)(0).Trim

Cheers

Hey @T_Y_Raju , you can try the following regex:

  1. If you want to find required text independent of “CUSTOMER INFO” :
    \d+\s[A-z]+.*
    image

  2. If you want to find required text while considering “CUSTOMER INFO” :
    (?<=CUSTOMER INFO\s)\d+\s[A-z]+.*
    image

  3. (?<=Deliver To)(\s.)(?=BILLING)
    image

1 Like