Javascript regex

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Javascript regex

Post 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 :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Javascript's regular expressions are most similar to PREG.

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