1 # 2.8.2 Regular Expression General Requirement
4 7¦9¦A#*::¦A:A#:qA::qA#::qA##::q¦
5 1¦5¦A#*::¦A##::A#::qA::qA#:q¦
6 # 2.8.3.1.2 BRE Special Characters
14 7¦11¦X\*Y\*8¦Y*8X*8X*Y*8¦
35 -1¦-1¦^*5<*9¦5<9*5<*9¦
39 1¦6¦A\(**9\)=¦A***9=79¦
45 ### GA113(2) GNU regex implements GA113(1)
47 ##-1¦-1¦\(^*ab\)¦^*ab¦
69 2¦6¦A\([34]$[34]\)B¦XA4$3BY¦
70 # 2.8.3.1.3 Periods in BREs
78 # 2.8.3.2 RE Bracket Expression
95 16¦16¦[^a-zA-Z0-9]¦pqrstVWXYZ23579#¦
105 9¦9¦[^]]\{1,\}¦]]]]]]]]X¦
106 -1¦-1¦[^]]\{1,\}¦]]]]]]]]¦
109 2¦8¦[a-z]*[[.].]][A-Z]*¦Abcd]DEFg¦
115 3¦3¦[][.-.]-0]¦ab0-]¦
119 -2¦-2¦[[.ab.][.CD.][.EF.]]¦yZabCDEFQ9¦
126 2¦7¦[[:alnum:]]*¦ aB28gH¦
127 2¦5¦[^[:alnum:]]*¦2 ,
\x7fa¦
128 2¦5¦[[:alpha:]]*¦ aBgH2¦
129 1¦6¦[^[:alpha:]]*¦2 8,
\x7fa¦
130 1¦2¦[[:blank:]]*¦
\r\x7f¦
131 1¦8¦[^[:blank:]]*¦aB28gH,
\x7f ¦
132 1¦2¦[[:cntrl:]]*¦
\x7f ¦
133 1¦8¦[^[:cntrl:]]*¦aB2 8gh,¦
134 2¦3¦[[:digit:]]*¦a28¦
135 1¦8¦[^[:digit:]]*¦aB gH,
\x7f¦
136 1¦7¦[[:graph:]]*¦aB28gH, ¦
137 1¦3¦[^[:graph:]]*¦
\x7f,¦
138 1¦2¦[[:lower:]]*¦agB¦
139 1¦8¦[^[:lower:]]*¦B2 8H,
\x7fa¦
140 1¦8¦[[:print:]]*¦aB2 8gH, ¦
141 1¦2¦[^[:print:]]*¦
\x7f ¦
142 2¦2¦[[:punct:]]*¦a,2¦
143 1¦9¦[^[:punct:]]*¦aB2 8gH
\x7f¦
144 1¦3¦[[:space:]]*¦
\r\x7f¦
145 2¦9¦[^[:space:]]*¦ aB28gH,
\x7f ¦
146 2¦3¦[[:upper:]]*¦aBH2¦
147 1¦8¦[^[:upper:]]*¦a2 8g,
\x7fB¦
148 2¦5¦[[:xdigit:]]*¦gaB28h¦
149 2¦7¦[^[:xdigit:]]*¦a gH,
\x7f2¦
161 3¦3¦[][.-.]-0]¦ab0-]¦
163 2¦6¦bc[d-w]xy¦abchxyz¦
166 -1¦-1¦[a-ce-f¦dBCCdE¦
167 2¦4¦b[n-zA-M]Y¦absY9Z¦
168 2¦4¦b[n-zA-M]Y¦abGY9Z¦
179 2¦4¦a[^ac-]c¦5abcde-¦
183 4¦6¦X[^---]Y¦X-YXaYXbY¦
184 # 2.8.3.3 BREs Matching Multiple Characters
188 -1¦-1¦[a-c][e-f]¦abcdef¦
189 3¦4¦[a-c][e-f]¦acbedf¦
190 4¦8¦abc*XYZ¦890abXYZ#*¦
191 4¦9¦abc*XYZ¦890abcXYZ#*¦
192 4¦15¦abc*XYZ¦890abccccccccXYZ#*¦
193 -1¦-1¦abc*XYZ¦890abc*XYZ#*¦
197 1¦10¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)¦abcdefghijk¦
198 3¦8¦43\(2\(6\)*0\)AB¦654320ABCD¦
199 3¦9¦43\(2\(7\)*0\)AB¦6543270ABCD¦
200 3¦12¦43\(2\(7\)*0\)AB¦6543277770ABCD¦
202 1¦10¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)¦abcdefghijk¦
203 -1¦-1¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(k\)\)\)\)\)\)\)\)¦abcdefghijk¦
207 1¦6¦a\(.*b\)¦ababbbc¦
209 1¦20¦a\(.*b\)c¦axcaxbbbcsxbbbbbbbbc¦
211 1¦7¦\(a\(b\(c\(d\(e\)\)\)\)\)\4¦abcdededede¦
213 1¦11¦\(a\(b\(c\(d\(e\(f\(g\)h\(i\(j\)\)\)\)\)\)\)\)\9¦abcdefghijjk¦
216 4¦7¦a\(b\(c\(d\(f\)*\)\)\)\4¦xYzabcdePQRST¦
218 -2¦-2¦\(a\(b\)\)\3¦foo¦
219 -2¦-2¦\(a\(b\)\)\(a\(b\)\)\5¦foo¦
222 1¦10¦a.*b¦abababvbabc¦
223 2¦5¦b*c¦abbbcdeabbbbbbcde¦
224 2¦5¦bbb*c¦abbbcdeabbbbbbcde¦
225 1¦5¦a\(b\)*c\1¦abbcbbb¦
226 -1¦-1¦a\(b\)*c\1¦abbdbd¦
227 0¦0¦\([a-c]*\)\1¦abcacdef¦
228 1¦6¦\([a-c]*\)\1¦abcabcabcd¦
233 1¦7¦\([a-c]*\)\{0,\}¦aabcaab¦
234 1¦2¦\(a\)\1\{1,2\}¦aabc¦
235 1¦3¦\(a\)010\{1,2\}¦aaaabc¦
236 1¦4¦\(\(a\)\1\)\{1,2\}¦aaaabc¦
241 1¦64¦a\{64\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
243 1¦7¦\([a-c]*\)\{0,\}¦aabcaab¦
244 -1¦-1¦\([a-c]*\)\{2,\}¦abcdefg¦
245 1¦3¦\([a-c]*\)\{1,\}¦abcdefg¦
246 -1¦-1¦a\{64,\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
250 0¦0¦\([a-c]*\)\{0,0\}¦foo¦
251 1¦63¦a\{1,63\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦
252 # 2.8.3.4 BRE Precedence
254 2¦20¦\^\[[[.].]]\\(\\1\\)\\*\\{1,2\\}\$¦a^[]\(1\)\*\{1,2\}$b¦
255 1¦6¦[[=*=]][[=\=]][[=]=]][[===]][[...]][[:punct:]]¦*\]=.;¦
256 1¦6¦[$\(*\)1]*¦$\()*^¦
259 2¦2¦\(*\)*\1*¦a*b*11¦
260 1¦5¦\(a\(b\{1,2\}\)\{1,2\}\)¦abbab¦
261 1¦1¦^\(^\(^a$\)$\)$¦a¦
265 # 2.8.3.5 BRE Expression Anchoring
269 -1¦-1¦^[a-zA-Z]¦99Nine¦
270 1¦4¦^[a-zA-Z]¦Nine99¦
273 -1¦-1¦\(^a\)\1¦^a^abc¦
277 -1¦-1¦\(^def\)¦abcdef¦
278 ### GA145(2) GNU regex implements GA145(1)
279 ##-1¦-1¦\(^a\)\1¦aabc¦
280 ##1¦4¦\(^a\)\1¦^a^abc¦
287 -1¦-1¦[a-z]*$¦99ZZxyz99¦
297 -1¦-1¦\(abc$\)¦abcdef¦
298 ### GA147(2) GNU regex implements GA147(1)
299 ##-1¦-1¦\(a$\)\1¦bcaa¦
300 ##2¦5¦\(a$\)\1¦ba$a$¦
308 1¦9¦^[a-zA-Z0-9]*$¦2aA3bB9zZ¦
309 -1¦-1¦^[a-z0-9]*$¦2aA3b#B9zZ¦