Extract text

Hi all i need to extract Mark Belt 15_abcd from below text.


149 8235689 MARK BELT 15_abcd
6 PC 33,28/1 60,84
Price (Gross) 1 PC 29,28
Order no.: 80094098/140
Confirmed Delivery date 18.02.2023


Thank you

Hi @Naga_Abhishek_Reddy_Chepp

Please use the following RegEx to extract the same:

MARK BELT\s(\d{2}_\w{4})

image

Hope this helps,
Best Regards.

1 Like

Hi @Naga_Abhishek_Reddy_Chepp ,

Try the below expression:

System.text.regularexpressions.regex.match(StringVariable,"\d+\s\d+\s(.*)").groups(1)

Regards,

1 Like

there are multiple rows of same kind of data
how to get same result from all rows

Example

149 8235689 MARK BELT 15_abcd
6 PC 33,28/1 60,84
Price (Gross) 1 PC 29,28
Order no.: 80094098/140
Confirmed Delivery date 18.02.2023

149 8235689 abcd john 15_abcd
6 PC 33,28/1 60,84
Price (Gross) 1 PC 29,28
Order no.: 80094098/140
Confirmed Delivery date 18.02.2023

149 8235689 woods 15_abcd
6 PC 33,28/1 60,84
Price (Gross) 1 PC 29,28
Order no.: 80094098/140
Confirmed Delivery date 18.02.2023

@Naga_Abhishek_Reddy_Chepp , you change the index to get all the matches:

System.text.regularexpressions.regex.Matches(TextVariable,“\d+\s\d+\s(.*)”)(index).Groups(1)

image

Regards,

1 Like

can we get the index count

@Naga_Abhishek_Reddy_Chepp

This will give you the count of matches:
In this case it is 3, so the indexes will be 0,1,2

System.text.regularexpressions.regex.Matches(TextVariable,"\d+\s\d+\s(.*)").Count

Regards,

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