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

question on JSLint

Expand Messages
  • kipenzam
    Hello, I have linted my program, and got this error : Problem at line 6 character 45: Insecure . . var reg = type === html ? /<!--.*?-->/g:
    Message 1 of 2 , Dec 28, 2010
    • 0 Attachment
      Hello,

      I have linted my program, and got this error :

      Problem at line 6 character 45: Insecure '.'.

      var reg = type === 'html' ? /<!--.*?-->/g: /\/\*.*?\*\//g;
      (If you see \, that is backslash)

      I've tried uncaptured group(?:.*)? for that, got same error.


      then how can I use characters like . ^ in regexp with secure? please help
    • Douglas Crockford
      ... Turn off the secure regexp option, or enumerate the set of characters that . should match.
      Message 2 of 2 , Dec 28, 2010
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "kipenzam" <kipenzam@...> wrote:
        > I have linted my program, and got this error :
        >
        > Problem at line 6 character 45: Insecure '.'.
        >
        > var reg = type === 'html' ? /<!--.*?-->/g: /\/\*.*?\*\//g;
        > (If you see \, that is backslash)
        >
        > I've tried uncaptured group(?:.*)? for that, got same error.
        >
        >
        > then how can I use characters like . ^ in regexp with secure? please help

        Turn off the secure regexp option, or enumerate the set of characters that . should match.
      Your message has been successfully submitted and would be delivered to recipients shortly.