I have a very basic problem with a regular expression in Javascript, I'm stuggling to get it working.
It want to remove
<text id="toto2" class="classTest">useless</text>
in the following String:
<svg><text id="toto"></text><text id="toto2" class="classTest">useless</text></svg>
So, here is my code:
var svgStr = '<svg><text id="toto"></text><text id="toto2" class="classTest">useless</text></svg>';
svgStr = svgStr.replace(/<text(.)*?class="classTest"(.)*?>(.)*?<\/text>/gm, '');
alert(svgStr);
It only prints:
'<svg></svg>'
(it is removing all the < text > nodes). I really do not understand what I'm doing wrong here, any help appreciated!
Thanks!