Loading ...
Sorry, an error occurred while loading the content.

Re: [jslint] Good and bad invocation, a.k.a. call a RegExp

Expand Messages
  • Paul Novitski
    ... May I ask why, if you re supplying the string as a hard-coded literal, are you testing it with a regular expression? Don t you as the scripter already know
    Message 1 of 3 , Oct 28, 2009
    • 0 Attachment
      At 10/27/2009 06:56 PM, robert.luxemburg wrote:
      >var ss = " ///// "(" \/ ");
      >var s = /\s/("/ /"); // " "


      May I ask why, if you're supplying the string as a hard-coded
      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?

      Curiously,

      Paul
      __________________________

      Paul Novitski
      Juniper Webcraft Ltd.
      http://juniperwebcraft.com
    Your message has been successfully submitted and would be delivered to recipients shortly.