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

Possible regexp typo

Expand Messages
  • sandyhead25
    I have found that JSLint complains about the forward slash in this: /= / but not in this: / = / It seems if the first example is worthy of complaint then
    Message 1 of 3 , Jun 8, 2009
    • 0 Attachment
      I have found that JSLint complains about the forward slash in this:
      /=\' /

      but not in this:
      / =\'/

      It seems if the first example is worthy of complaint then the second example should be so worthy.

      Here are some examples for immediate testing in the tool:
      "use strict";
      var x = x.replace(/=\' /g, '=\'');

      "use strict";
      var x = x.replace(/ =\' /g, '=\'');
    • Douglas Crockford
      ... JSLint complains about the first case because of possible confusion with the little used /= operator. It does not have a complaint about the second case.
      Message 2 of 3 , Jun 8, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "sandyhead25" <austin.cheney@...> wrote:
        >
        > I have found that JSLint complains about the forward slash in this:
        > /=\' /
        >
        > but not in this:
        > / =\'/
        >
        > It seems if the first example is worthy of complaint then the second
        > example should be so worthy.

        JSLint complains about the first case because of possible confusion with the little used /= operator. It does not have a complaint about the second case.
      • sandyhead25
        ... Ah, that makes perfect sense.
        Message 3 of 3 , Jun 8, 2009
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > --- In jslint_com@yahoogroups.com, "sandyhead25" <austin.cheney@> wrote:
          > >
          > > I have found that JSLint complains about the forward slash in this:
          > > /=\' /
          > >
          > > but not in this:
          > > / =\'/
          > >
          > > It seems if the first example is worthy of complaint then the second
          > > example should be so worthy.
          >
          > JSLint complains about the first case because of possible confusion with the little used /= operator. It does not have a complaint about the second case.
          >

          Ah, that makes perfect sense.
        Your message has been successfully submitted and would be delivered to recipients shortly.