How to provide regex for the below mentioned data

Can any one help me to solve this regex. these are the first and second set of values. In first set how can I get DEF value using regex
‘ABC 1234 DEF 1234
GHIJ 1221 KLM 9870’
ABC 2312.1 DEF 3452.1 WXYZ 1213.0
GHIJ 2134 KLM 9870 STVUV 1 6745 7

Hi,

Do you need to extract 123 and 3452.1? If so, the following pattern will work.

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

image

Regards,

Happy automation

Instead of trying with matches activity,

you can try with regex also by using assign activity
assign activity :

assign variable Type is = System.Text.RegularExpressions.Match
value = System.Text.RegularExpressions.Regex.Matches(str,“(?<=DEF\s)[\d.]+”)

after that based on index you can call it


@Chippy_Kolot

hey !Refer the below regex Pattern
(?<=DEF\s+)\d+.\d+
image

2 Likes

Hello @Chippy_Kolot

Try With This Once

image