I have this string in JavaScript:
s = "</p><ol><li>First\n</li><li>Second\n</li></ol><p>"
Then I do this (to remove the outer "</p>...<p>"):
s = s.replace(/^<\/([^> ]+)[^>]*>(.*)<\1>$/,"$2");
Nothing happens (s is unchanged, and using match() returns false), but if I go try it at http://www.regular-expressions.info/javascriptexample.html, it works!
I've tried all sorts of things (creating a separate regExp object, using //g, taking out the ^$, replacing [^> ]+ with [a-z0-9]*...) but nothing makes any difference.
It's driving me nuts. can anyone tell me what I'm doing wrong?