Page 1 of 1

Javascript regex

Posted: Wed Feb 28, 2007 2:17 pm
by alex.barylski
Is it different than PHP? One is POSIX the other PREC?

I'm having a helluva time constructing something which meets these requirements:

I'm given an HTML string

1) I need to remove the instance of <base> and store the entire result in a variable
2) I Then need to inject that matched <base> *right* after the <head> tag

Anyone care to help me out? :)

Any help appreciated, thanks :)

Posted: Wed Feb 28, 2007 3:02 pm
by feyd
Javascript's regular expressions are most similar to PREG.

Post what you've attempted thus far with some tests.