I'm trying to build a regular expression which allows me to remove tags in a string. These tags always look like this: {...}.
I've tried \{.*\} so far but unfortunately this won't work if these tags occur two times. For Example: {123} Hello {asdas}. The entire line would be deleted since it starts with a { and end with a }. So, how can I avoid this behaviour?
Thanks in advance.
\{[^}]*\}
would probably do it.
An opening bracket, followed by any number of anything besides a closing bracket, followed by a closing bracket.
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