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

Slight regexp problem

Expand Messages
  • pauanyu
    var regexp = /[]]/; I understand the second error is JSLint telling me I need to escape the ] , and that s fine. The problem is the first error. It says I
    Message 1 of 3 , Jul 18, 2009
    • 0 Attachment
      var regexp = /[]]/;

      I understand the second error is JSLint telling me I need to escape the "]", and that's fine. The problem is the first error. It says I need to escape "-", but there isn't any "-" in the code at all!
    • Douglas Crockford
      ... Thanks. Please try it now.
      Message 2 of 3 , Jul 18, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
        >
        > var regexp = /[]]/;
        >
        > I understand the second error is JSLint telling me I need to escape
        > the "]", and that's fine. The problem is the first error. It says I
        > need to escape "-", but there isn't any "-" in the code at all!

        Thanks. Please try it now.
      • pauanyu
        ... Yeah, that s better. What about the other weird characters like /[^]/ and /[-]/? Wouldn t those be empty class as well?
        Message 3 of 3 , Jul 18, 2009
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > Thanks. Please try it now.
          >

          Yeah, that's better.

          What about the other weird characters like /[^]/ and /[-]/? Wouldn't those be "empty class" as well?
        Your message has been successfully submitted and would be delivered to recipients shortly.