I’m prototyping some text processing to prep research data for coding, and I’ve got a javascript replace statement the bombs in jsFiddle and I cannot figure out why:
mE[1] = mE[1].replace(/<p.*>/ig, ''); // <<< this line
I’m trying to remove any opening paragraph tag.
If you look at http://jsfiddle.net/jotarkon/2e5gq/, uncomment that line and see that it the script fails.
— click on the Heading to fire the funciton
This is driving me nuts. any ideas what’s going wrong?
The problem appears to be an actual illegal character somewhere in that line, and I don’t think it has anything to do with the regex. Try typing the whole line in from scratch and delete that one. When I do that, the fiddle works fine (well, it doesn’t get that error at least).
edit — the illegal character is right after the semicolon on that line. Starting from the “//” on your “this line” comment, hit backspace a few times to erase the bogus character and the semicolon, then re-type the semicolon.
edit some more – The characters are the sequence C2 AD (hex).