regex.js
638 Bytes
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
foo(/a/)
foo(/a/g)
foo( /a/ )
foo( /a/g )
foo(/a/, bar)
foo(/a/g, bar)
foo(/a/, /a/g, /b/g, /b/)
arr = [/a/]
arr = [/a/g]
arr = [ /a/ ]
arr = [ /a/g ]
obj = {re: /a/}
obj = {re: /a/g}
obj = { re: /a/ }
obj = { re: /a/g }
re = foo ? /a/ : RegExp(bar)
re = foo ? /a/g : RegExp(bar)
/a/.exec(foo)
/a/g.exec(foo)
foo = (1/2) + /a/.exec(bar)[0]
foo = (1/2) + /a/g.exec(bar)[0]
re = /a/// comment
re = /a/g// comment
re = /a//* comment */
re = /a/g/* comment */
re = /a/ // comment
re = /a/g // comment
re = /a/ /* comment */
re = /a/g /* comment */
silly = /a/ ? true : false
if (/a/ == "/a/") {}
if (/a/ && foo) {}
if (/a/ || foo) {}