The following regex works on PCRE, & Python but not on Javascript.
/(?s)\/\*\*\*\/\s\(function\(module,\sexports\)\s\{(.*?)\}\)\,/g
It seems that Javascript does not recognize (?s). Is there a Javascript equivalent for this?
The following regex works on PCRE, & Python but not on Javascript.
/(?s)\/\*\*\*\/\s\(function\(module,\sexports\)\s\{(.*?)\}\)\,/g
It seems that Javascript does not recognize (?s). Is there a Javascript equivalent for this?
(?s) enables the s regex flag for the remainder of the pattern, which means that the . matches any character at all, instead of its default behavior of matching any character except newline. However, JavaScript, besides not supporting (?flags), doesn't have an s flag to begin with. Instead, we can replace the . pattern with [^] (the negation of an empty character class), which has the same effect of matching any character at all.
The overall pattern is then
/\/\*\*\*\/\s\(function\(module,\sexports\)\s\{([^]*?)\}\)\,/g