I am trying to do a modify a text which contain some special tags. I believe it should be possible by a single regular expression, but am stuck...
What I want to do is easier to explain by an example:
If I have this text:
{Lorem Ipsum} is simply {dummy text} of the printing and typesetting industry.
I want as a result this:
<span>Lorem Ipsum</span> is <span>simply dummy</span> text of the printing and typesetting industry.
I a } is encountered with no previous matching { then it should be ignored.
I know I can match all inner texts with this \{(.*?)\} but am lost on how to proceed, any help would be appriciated.