I have this heregex in coffeescript trying to catch urls:
regex = /// (
((f|ht){1}tp(s)?://)
[-a-zA-Z0-9@:%_\+.~?&//=]+
)
///
but how do set a global and ignore case flag? I’ve tried this:
newregex = regex.compile(regex,"gi")
but that doesn’t work either
Coffeescript converts your heregex into a single line regex:
And javascripts regex syntax
/regex/modsis shorthand for regex.compile(“regex”,”mods”), so you don’t need to compile it. You can just add the modifiers to the heregex: