Re: [jslint] Good and bad invocation, a.k.a. call a RegExp
- At 10/27/2009 06:56 PM, robert.luxemburg wrote:
>var ss = " ///// "(" \/ ");May I ask why, if you're supplying the string as a hard-coded
>var s = /\s/("/ /"); // " "
literal, are you testing it with a regular expression? Don't you as
the scripter already know its value?
I realize that the question "Why would you ever do such a thing?" is
very different from "Is it legal syntax?" But it is a mystery to my
why someone would call up the RegExp engine just to find out whether
a known quoted string contains certain patterns. Is it because the
string is supplied by a server-side script and not by a human hand?
Or because you simply enjoy using regular expressions, or exploring
unusual syntax in your scripts?
Juniper Webcraft Ltd.