-
Notifications
You must be signed in to change notification settings - Fork 5
/
TODO
45 lines (35 loc) · 1.31 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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.