Need a regex for certain commandline

Input : { “create” : { “_index” : “test-1-may-ibb-mom-report”, “_id” : “9876” } }
Need output : { “create” : { “_index” : “test-1-may-ibb-mom-report”, “_id” : "
Should eliminate only : 9876"}}

Hi @Haarish_S

Use the below regex expression

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(.*(?=\d{4}\”\s\}\s\}))”)

Hope it helps!!

1 Like

Hi @Haarish_S

Try this

(?={).*(?=: )

I hope it helps!!

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