Find file
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (35 sloc) 1.31 KB
Feature ideas:
- hover over character class should show an ascii map
- figure out a way to tell users that /foo$/ matches "foo\n"
- bookmark / share url
Things I wished I had time to implement, but will probably never have time for:
- Handle differences between various regexp implementations (e.g. php vs javascript)
- python auto anchors
- other languages can use % % as the regexp seperator
- More lint rules:
- x*x => x+
- x*x* => x*
- xx* => x+
- [0-9] => \d
- is it possible to detect rules which can cause a DOS?
.*.*foo or (.*)*
- detect www., .com or .net and
suggest replacing "." with "\.".
A few things I learned while writing this code:
/\b/ matches word boundary
/[\b]/ matches back space (\x08)
so the identity escapes are useful in the following cases:
- outside ranges: ^$\.*+?()[]{}|
- inside ranges: \]-
the spec doesn't really talk about octal escapes. We'll ignore them for now.
/[\92]/ matches '9' or '2'
/[\12]/ doesn't match '2'. It matches \x0a.
don't know how to handle \01, \010, etc. there is a potential
confusion between octal & group ref?
I decided to punt on this issue and just fail to parse such expressions.
Internet Explorer is weird when it comes to this:
/[]x]/.test("x") is true in IE, but false in most other browsers.