it fixes the issue Hm, I cannot see an easy way to do it with a regexp only. You might first parse out the regexes (/<\/.*?\/>[^\/]*/), store them in an array and replace them by something easy yet non-clashing ($1), then run your regex and reinsert the regexes.
How to extract a quoted string using regular expression? OR How to use this particular regular expression ("[^&quo