Need to Extract the data before the match word using Regex

This is the string “gsdx 15h x 1jj 3.144 GA 5,67 INR 79.675,60”,I need to extract the 3.144 by using GA as match character and the other one is need to extract 5,67 by using INR as match character,Thanks in Advance

@raghuram_katuri
(?<=GA\s)(.?(?=INR))
[\d.]+\s(.
?(?=GA))

Hi,

How about the following pattern?

[\d.,]+(?=\s*GA)

image

[\d.,]+(?=\s*INR)

image

Regards,

Hey hope this helps @raghuram_katuri
Here we are using look before the keyword GA and INR
system.text.regex.regularexpression.match(“InputString”,“(\d{0,},{0,}\d{0,})(?=\sINR)“).value
system.text.regex.regularexpression.match(“InputString”,”(\d{0,}.{0,}\d{0,})(?=\s
GA)”).value
image
image

Cheers.

Post Updated. Happy Automation

Thanks @raja.arslankhan

1 Like

Thanks @Yoichi

@raghuram_katuri Thanks…Happy Automation

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