When you use the string form of the RegExp constructor you
need to escape the escapes (ie \\ ) because the first one applies
to string escaping so the regexp thinks you're looking for w* (or a
lot of w's). You can also create your regexp using the more natural
looking format, which also make it easier to read. Here's two
examples, both should match the same thing:
var myRegExp1 = new
RegExp("<!--(\\s)*InstanceBeginEditable(\\s)*name=\"(\\w)*\"(\\s)*-->","g");
var myRegExp2 =
/<!--(\s)*InstanceBeginEditable(\s)*name="(\w)*"(\s)*-->/g;
Chris
Adobe Dreamweaver Engineering