forked from iconnect/regex
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtdfa-macros.txt
150 lines (150 loc) · 31.9 KB
/
tdfa-macros.txt
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|name |caps|regex=regex=regex=regex=regex |examples |anti-examples |fails|parser |comment
|----------------|----|------------------------------------------|------------------------------------------|-----------------------------------------|-----|-----------------|------------------------------------------
|%address.ipv4 |0 |[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0\|0.0.0.0 | | |parseSeverity |an a.b.c.d IPv4 address
| | |\-9]{1,3} |123.45.6.78 |foo | | |
| | | |9.9.9.9 |1234.0.0.0 | | |
| | | |255.255.255.255 |1.2.3 | | |
| | | | |1.2.3. | | |
| | | | |1.2..4 | | |
| | | | |www.example.com | | |
| | | | |2001:0db8:85a3:0000:0000:8a2e:0370:7334 | | |
|%date |0 |[0-9]{4}-[0-9]{2}-[0-9]{2} |2016-12-31 | | |parseDate |a YYYY-MM-DD format date
| | | |0001-01-01 |2016/01/31 | | |
| | | |1000-01-01 |2016-1-31 | | |
| | | | |2016-01-1 | | |
| | | | |2016-001-01 | | |
|%date.slashes |0 |[0-9]{4}/[0-9]{2}/[0-9]{2} |2016/12/31 | | |parseSlashesDate |a YYYY/MM/DD format date
| | | |0001/01/01 |2016-01-31 | | |
| | | |1000/01/01 |2016/1/31 | | |
| | | | |2016/01/1 | | |
| | | | |2016/001/01 | | |
|%datetime |1 |@{%date}[ T]@{%time}(@{%timezone}| UTC)? |2016-12-31 23:37:22.525343 UTC | | |parseDateTime |ISO-8601 format date and time + simple va\
| | | |2016-12-31 23:37:22.525343 |2016-12-31 23:37:22.525343 EST | | |\riants
| | | |2016-12-31 23:37:22 | | | |
| | | |2016-12-31T23:37:22+0100 | | | |
| | | |2016-12-31T23:37:22-01:00 | | | |
| | | |2016-12-31T23:37:22-23:59 | | | |
| | | |2016-12-31T23:37:22Z | | | |
|%datetime.8601 |0 |@{%date}T@{%time}@{%timezone} |2016-12-31T23:37:22.343Z | | |parseDateTime8601|YYYY-MM-DDTHH:MM:SS[.Q*](Z|[+-]HHMM) form\
| | | |2016-12-31T23:37:22-0100 |2016-12-31 23:37:22.525343 EST | | |\at date and time
| | | |2016-12-31T23:37:22+23:59 | | | |
|%datetime.clf |0 |[0-9]{2}/@{%shortmonth}/[0-9]{4}:[0-9]{2}\|10/Oct/2000:13:55:36 -0700 | | |parseDateTimeCLF |Common Log Format date+time: %d/%b/%Y:%H:\
| | |\:[0-9]{2}:[0-9]{2} [+-][0-9]{2}:?[0-9]{2\|10/Oct/2000:13:55:36 +07:00 |2016-12-31T23:37+0100 | | |\%M:%S %z
| | |\} | |10/Oct/2000:13:55:36-0700 | | |
| | | | |10/OCT/2000:13:55:36 -0700 | | |
| | | | |10/Oct/2000:13:55 -0700 | | |
| | | | |10/Oct/2000:13:55Z | | |
|%email.simple |0 |[a-zA-Z0-9%_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0\|user-name%[email protected] | | |- |an email address
| | |\-9.-]+ | |not-an-email-address | | |
| | | | |@not-an-email-address | | |
|%frac |1 |-?[0-9]+(\.[0-9]+)? |0 | | |parseInteger |a decimal natural number
| | | |1234567890 |0A | | |
| | | |00 |+0 | | |
| | | |01 |0. | | |
| | | |-1 |.0 | | |
| | | |-0 |. | | |
| | | |0.1234567890 |- | | |
| | | |-1.0 |-. | | |
| | | | |-1. | | |
| | | | |-.1 | | |
|%hex |0 |[0-9a-fA-F]+ |0 | | |parseHex |a string of one or more hexadecimal digit\
| | | |12345678 |0x10 | | |\s
| | | |0abcdef |0z | | |
| | | |0ABCDEF |-1a | | |
| | | |00 | | | |
| | | |010 | | | |
|%id |0 |_*[a-zA-Z][a-zA-Z0-9_]* |a | | |- |a standard C-style alphanumeric identifie\
| | | |A |1 | | |\r (with _s)
| | | |A1 |_ | | |
| | | |a_ |__ | | |
| | | |a1_B2 |__1 | | |
| | | |_abc |1a | | |
| | | |__abc |a' | | |
|%id' |0 |_*[a-zA-Z][a-zA-Z0-9_']* |a | | |- |a standard Haskell-style alphanumeric ide\
| | | |A |1 | | |\ntifier (with '_'s and '''s)
| | | |A1 |_ | | |
| | | |a_ |__ | | |
| | | |a1_B2 |__1 | | |
| | | |_abc |1a | | |
| | | |__abc |' | | |
| | | |a' |'a | | |
| | | |_a' |_' | | |
| | | |a'b |_1' | | |
|%id- |0 |_*[a-zA-Z][a-zA-Z0-9_'-]* |a | | |- |an identifier with -s
| | | |A |1 | | |
| | | |A1 |_ | | |
| | | |a_ |__ | | |
| | | |a1_B2 |__1 | | |
| | | |_abc |1a | | |
| | | |__abc |' | | |
| | | |a' |'a | | |
| | | |_a' |_' | | |
| | | |a'b |_1' | | |
| | | |a- | | | |
| | | |a1-B2 | | | |
| | | |a1-B2- | | | |
|%int |0 |-?[0-9]+ |0 | | |parseInteger |a decimal integer
| | | |1234567890 |0A | | |
| | | |00 |+0 | | |
| | | |01 | | | |
| | | |-1 | | | |
| | | |-0 | | | |
|%nat |0 |[0-9]+ |0 | | |parseInteger |a string of one or more decimal digits
| | | |1234567890 |0A | | |
| | | |00 |-1 | | |
| | | |01 | | | |
|%shortmonth |1 |(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|\|Jan | | |parseShortMonth |three letter month name: Jan-Dec
| | |\Nov|Dec) |Feb |jan | | |
| | | |Dec |DEC | | |
| | | | |January | | |
| | | | |01 | | |
| | | | |1 | | |
|%string |1 |"([^"\]+|\\[\"])*" |"" |" | |parseString |a double-quote string, with simple \ esca\
| | | |"foo" |"aa | | |\pes for \s and "s
| | | |"\"" | | | |
| | | |"\"\"" | | | |
| | | |"\"\\\"" | | | |
| | | |"\"foo\"" | | | |
| | | |"" | | | |
|%string.simple |0 |"[^"[:cntrl:]]*" |"" | | |parseSimpleString|a simple quoted string
| | | |"foo" |" | | |
| | | |"\" |"\"" | | |
| | | |"" |"\"\"" | | |
| | | | |"\"\\\"" | | |
| | | | |"\"foo\"" | | |
| | | | |"aa | | |
|%syslog.severity|1 |(emerg|panic|alert|crit|err|error|warning\|emerg | | |parseSeverity |syslog severity keyword (debug-emerg)
| | |\|warn|notice|info|debug) |panic |Emergency | | |
| | | |alert |ALERT | | |
| | | |crit | | | |
| | | |err | | | |
| | | |error | | | |
| | | |warn | | | |
| | | |warning | | | |
| | | |notice | | | |
| | | |info | | | |
| | | |debug | | | |
|%time |1 |[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]+)? |00:00:00 | | |parseTimeOfDay |a HH:MM:SS[.Q+]
| | | |23:59:59 |235959 | | |
| | | |00:00:00.1234567890 |10:20 | | |
| | | | |A00:00:00 | | |
| | | | |00:00:00A | | |
| | | | |23:59:59. | | |
|%timezone |1 |(Z|[+-][0-9]{2}:?[0-9]{2}) |Z | | |parseTimeZone |an IOS-8601 TZ specification
| | | |+00:00 |00 | | |
| | | |+0000 |A00:00 | | |
| | | |+0200 |UTC | | |
| | | |-0100 |EST | | |
| | | | | EST | | |
|%url |1 |([hH][tT][tT][pP][sS]?|[fF][tT][pP])://[^\|https://mathiasbynens.be/demo/url-regex | | |- |a URL
| | |\[:space:]/$.?#].[^[:space:]]* |http://foo.com/blah_blah |http:// | | |
| | | |http://foo.com/blah_blah/ |http://. | | |
| | | |http://foo.com/blah_blah_(wikipedia) |http://.. | | |
| | | |http://foo.com/blah_blah_(wikipedia)_(aga\|http://../ | | |
| | | |\in) |http://? | | |
| | | |http://www.example.com/wpstyle/?p=364 |http://?? | | |
| | | |HTTPS://foo.bar/?q=Test%20URL-encoded%20s\|http://foo.bar?q=Spaces should be encoded| | |
| | | |\tuff |// | | |
| | | |HTTP://223.255.255.254 |http://##/ | | |
| | | |ftp://223.255.255.254 |http://## | | |
| | | |FTP://223.255.255.254 |http://##/ | | |