I have a string like this -
['name' {d763e18f-1719-480b-bcd6-8fea7bad894e} Parameter, 'class' {8471633e-4a54-4c86-bd2b-56d58baf2fbb} Parameter, 'id' {23471633e-4a54-4c86-bd2b-56d58baf2fbb} Parameter]
And I want the following result -
['name' , 'class' , 'id']
All the content between the word in quotes ''
and ,
should be deleted.
How do I achieve this? Thanks!
You can use the following to match:
('\w+'\s*).*?(?=[,\]])
And replace with $1
regex in java would be ('\\w+'\\s*).*?(?=[,\\]])
See DEMO
You can use this regex.
('\w+'\s*).*?(?=[,\]])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With