Regex Issues

Hi,

I am using “(?:abc|de|fg)”:\K([0-9]{0,9}.)\d+ regex to capture below data
{
“abc”:“1550412000”,
“de”:209080.000,
“fg”:81144.000
},
{
“abc”:“1550415600”,
“de”:209208.000,
“fg”:87728.000
},
{
“abc”:“1550419200”,
“de”:202024.000,
“fg”:83896.000
},
Tested above regex https://regex101.com/ it’s working fine, but isn’t working in Uipath Mathches activity. Can some one help me out.

@bsamala

Welcome to the UIpath Community.

Show me the expression you wrote there and what error are you getting ?

Alternatively you can use the Json.net activities to deserialize any json that you need.

i given the pattern as “(?:abc|de|fg)”:\K([0-9]{0,9}.)\d+ which is working fine and able to capture data in regex101
i am getting “end of expression expected” error.

@bsamala

System.Text.RegularExpressions.Regex.Matches(“yourString”,“searchPattern”)

The above expression will give you result as collection of found results. Then use For Each loop Activity to print all values.

@bsamala you can try below regex pattern.

 System.Text.RegularExpressions.Regex.Matches(yourStringVariable,“(?<=(abc|de|fg)[\W]:[\W]?)[\d]{0,9}.\d+")