Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (35 sloc) 1.341 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
etc.
- 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:
1.
/\b/ matches word boundary
/[\b]/ matches back space (\x08)
so the identity escapes are useful in the following cases:
- outside ranges: ^$\.*+?()[]{}|
- inside ranges: \]-
2.
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.
3.
Internet Explorer is weird when it comes to this:
/[]x]/.test("x") is true in IE, but false in most other browsers.
Jump to Line
Something went wrong with that request. Please try again.