Re: [jslint] regex parsing - [^]
- douglascrockford <douglas@...> wrote on Sat, 19 Jan 2013
at 13:20:21 -0000 in <kde6il+8gnb@...>:
> One of the design principles behind JSLint is that if a feature isIt would really help if the documentation explained why [^] was
> problematic, and if it can be completely replaced with another
> feature that is less problematic, then the more problematic feature
> should not be allowed.
No \A or \Z anchors to match the start or end of the string. Use a caret or dollar instead.
Lookbehind is not supported at all. Lookahead is fully supported.
No atomic grouping or possessive quantifiers.
No Unicode support, except for matching single characters with \uFFFF.
(Note form me on this: only the oldest implementations suffer this limitation today)
No named capturing groups. Use numbered capturing groups instead.
No mode modifiers to set matching options within the regular expression.
[^] is confusing and definitely should be avoided.
--- In email@example.com, "Felix E. Klee" wrote:
> On Sat, Jan 19, 2013 at 3:01 AM, george_weilenmann
> > right as it is confusing.
> So, which regular expression syntax should JSLint enforce? POSIX? Is
> Given that there are many dialects of regular expressions and not one
> single authoratitive standard, in my opinion, JSLint should enforce:
> Regular expressions as defined by ECMAScript. :-)
> (minus dangerous constructs)