Literal Regular Expression Safe Regular Expression
... sorry for the redundant title but that's exactly what is this post about ... after yesterday explanation about problem, logic, and solution, to grab valid strings inside JS code, here I am with the literal RegExp able to grab literals RegExps in a generic JavaScript code. Why Do Not Add Just A "/" Into Other Strings RegExp One comment gave me the hint to write this second post about RegExps. While time is a bit over during days, this answer is simple, but not obvious! Differences between strings and literal regular expressions are basically these: there must be at least one char, or the parser will consider the literal RegExp an inline comment // the slash does NOT necessary need to be escaped. If we have a slash inside a range [a/b] the latter one won't break the RegExp and the slash will be considered just one valid char in that range there could be one or more chars after, where i(ignore case), g(match all), and m(multi line) can be present one or more times L...