Regex, check from left and right - problem

Hello,

I want to extract text between string. Let say this is my string:

{“conditionCode”:“X51”,“conditionDescription”:“We may be able to assess this.”,“conditionType”:“ADMIN”},
{“conditionCode”:“X50”,“conditionDescription”:“Despite research we have not succeeded.”,“conditionType”:“ADMIN”}]}

i wante extract everything for conditionDescription. I have used regex pattern:

(?<=“conditionDescription”:").*(?=.",“conditionType”)

Looks good on online regex, also looks good on RegEx builder


But that is what i receive:

We may be able to assess this.",“conditionType”:“ADMIN”},
{“conditionCode”:“X50”,“conditionDescription”:“Despite research we have not succeeded.”,“conditionType”:“ADMIN”}]}

It just one match, with strings which should be ignored like conditionType

when i need two matches:

1.We may be able to assess this

2.Despite research we have not succeeded

Hi @Add_Bddd

It appears to be a JSON Array. It is not advised to use regex on it as other activities are available to handle the JSON Array

image

Read this post

Still if you want the regex

(?<=\"conditionDescription\"\:\").*(?=\"\,\"conditionType\")

Heyy!

Try this

And let me know:

Regards,
NaNi

Hi,

Can you try to add ? just after * as the following?

(?<=“conditionDescription”:“).*?(?=.”,“conditionType”)

Regards,