-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathregex.txt
More file actions
84 lines (68 loc) · 1.48 KB
/
regex.txt
File metadata and controls
84 lines (68 loc) · 1.48 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Regex alternation in parens followed by literal char
(test|render)<
==>
Program(Term)
# Pipe character in a term (no parens)
test|render
==>
Program(Term)
# Parens with alternation — no trailing char
(foo|bar)
==>
Program(Term)
# Parens with alternation and trailing chars
(foo|bar)baz
==>
Program(Term)
# Complex regex: quantifiers, anchors, character classes
^foo.*bar$
==>
Program(Term)
# Character class
[abc]+
==>
Program(Term)
# Regex with escaped paren
func\(arg\)
==>
Program(Term)
# Two regex terms joined with OR keyword
(test|render) or (foo|bar)
==>
Program(OrExpr(Term,Term))
# Two regex terms implicitly ANDed
(test|render) (foo|bar)
==>
Program(AndExpr(Term,Term))
# File prefix still works in regex mode
file:test.js
==>
Program(PrefixExpr(FileExpr))
# Prefix filter combined with regex term
file:test.js (test|render)<
==>
Program(AndExpr(PrefixExpr(FileExpr),Term))
# Negation of prefix still works in regex mode
-file:test.js
==>
Program(NegateExpr(PrefixExpr(FileExpr)))
# Quoted string still works in regex mode
"(test|render)"
==>
Program(QuotedTerm)
# Multiple prefix filters with regex term
file:test.js lang:TypeScript (render|mount)
==>
Program(AndExpr(PrefixExpr(FileExpr),PrefixExpr(LangExpr),Term))
# Dash without prefix is a plain word (not negation)
-pattern
==>
Program(Term)
# 'or' at start of input is a plain word
or
==>
Program(Term)
# Regex with pipe at top level between prefix and term
repo:myorg (init|setup)
==>
Program(AndExpr(PrefixExpr(RepoExpr),Term))