Regex Manipulation- Help

Hi Team,

I want regex expression for the below text

 ""ClientCode"": ""C10009"",     ""SiteCode"": ""ALLENTOWN DEMO"",     ""OrdeRequestVendorCode"": ""Signant Health"",

From the text, I have to extract the C10009 from the string.

Pls guide me to extract the data over regex.

Cheers!

Hi @Iswarya_P1

Try this

Hi,

Try this
[A-Z]+\d{5}

I hope it helps

@Iswarya_P1

Is this a json string that you are getting?

If so use desirialize json and then use
Jobj("ClientCode").ToString

Or if you need regex only then try this

System.Text.RegularExpressions.Regex.Match(str,"(?<=ClientCode"""": """")[A-Za-z0-9]*").Value

Cheers

@Iswarya_P1

Try this

Regards

The client code data may vary. It will not have the same character and number of digit counts. I want to extract the client code information from the string

Cheers!

@Iswarya_P1

you can use the below mentioned regex expression so what ever the client id it will extract the data

Regards

So try this
[A-Z]+\d+

Hi @Iswarya_P1
““ClientCode””:\s*“”(.?)“”.

Sorry, It will work but the regex matched for two more data in my string. So Will you pls give me, How to extract the client code after the colon? It will be very helpful for me.

Cheers!

@Iswarya_P1

Try this

(?<=ClientCode\"": "").*([A-Z]\d+)

@Iswarya_P1

Can you share the properties of that activity.

regards

(?<=ClientCode"“:\s+”")[A-Z]+\d+

Try this hope it works

@Iswarya_P1

Please check the above

Cheers

@Iswarya_P1

try this and let me know

regards

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