The single line regex modifier is not available for Javascript
Nov 10, 2011
1 minute read

The single line regex modifier is not available for Javascript

To prevent it replace your . by [\s\S] :

start(.*?)end

become

start([\s\S]*?)end

I had trouble with this syntax :

var myregExp = new RegExp ("start([\s\S]*?)end", "g");

Instead I used that way without trouble :

var myregExp = /start([\s\S]*?)end/g;

Source : http://fire-studios.com/blog/2008/overview-of-javascript-regex



comments powered by Disqus