1 # Large number of macros in one regexp.
2 E$H [A-Z]\\d\\s?\\d[A-Z]{2}|[A-Z]\\d{2}\\s?\\d[A-Z]{2}|[A-Z]{2}\\d\\s?\\d[A-Z]{2}|[A-Z]{2}\\d{2}\\s?\\d[A-Z]{2}|[A-Z]\\d[A-Z]\\s?\\d[A-Z]{2}|[A-Z]{2}\\d[A-Z]\\s?\\d[A-Z]{2}|[A-Z]{3}\\s?\\d[A-Z]{2} A12BC (0,5)
6 E$H SAME AB12 3CD (0,8)
8 E$H SAME AB1C 2DE (0,8)
10 # Test leftmost and longest matching and some tricky submatches
11 #E (?l)(wee|week)(night|knights)s* weeknights (0,10)(0,3)(3,10)
12 #E SAME weeknightss (0,11)(0,3)(3,10)
13 # Tests for nonstandard syntax extensions.
15 # Zero width assertions
27 EH \Bx\b aax xxx (2,3)
29 # Shorthands for character classes
30 EH \w{1,} ,.(a23_Nt-öo) (3,9)
31 EH \d{1,} uR120_4=v4 (2,5)
32 EH \D{1,} 120d_=vA4s (3,8)
33 EH \w+ ,.(a23_Nt-öo) (3,9)
34 EH \d+ uR120_4=v4 (2,5)
35 EH \D+ 120d_=vA4s (3,8)
36 # Quoted special characters
39 # Test the \x1B and \x{263a} extensions for specifying 8 bit and wide
40 # characters in hexadecimal.
44 # test_comp("\\x",REG_EXTENDED,0)
45 # test_nexec("\000",1,0,REG_OK,0,1)
46 # test_comp("\\xr",REG_EXTENDED,0)
47 # test_nexec("\000r",2,0,REG_OK,0,2)
50 E$H \\x{5}r \005r (0,2)
51 # test_comp("\\x{}",REG_EXTENDED,0)
52 # test_nexec("\000",1,0,REG_OK,0,1)
53 # test_comp("\\x{}r",REG_EXTENDED,0)
54 # test_nexec("\000r",2,0,REG_OK,0,2)
55 # Tests for (?inrU-inrU) and (?inrU-inrU:)
56 EH foo(?i)bar fooBaR (0,6)
57 EH foo(?i)bar|zap fooBaR (0,6)
62 EiH foo(?-i:zap)zot FoOzapZOt (0,9)
63 EiH SAME FoOzApZOt NOMATCH
64 EH foo(?i:bar|zap) foozap (0,6)
68 EH foo(?U:o*)(o*) foooo (0,5)(3,5)
70 EH foo(?# This here is a comment. )bar foobar (0,6)
72 EH \((\Q)?:\<[^$\E) ()?:\<[^$ (0,9)(1,9)
73 EH \Qabc\E.* abcdef (0,6)
74 EH \Qabc\E.*|foo parabc123wxyz (3,13)
75 EH SAME fooabc123wxyz (0,3)
76 # Back referencing tests
77 EH ([a-z]*) \1 foobar foobar (0,13)(0,6)
78 # Searching for a leftmost longest square (repeated string)
79 EH (.*)\1 foobarfoobar (0,12)(0,6)
80 EH a(b)*c\1 acb NOMATCH
81 EH SAME abbcbbb (0,5)(2,3)
82 EH SAME abbdbd NOMATCH
83 EH ([a-c]*)\1 abcacdef (0,0)(0,0)
84 EH SAME abcabcabcd (0,6)(0,3)
85 EH (a*)*(x)(\1) x (0,1)(0,0)(0,1)(1,1)
86 EH SAME ax (0,2)(1,1)(1,2)(2,2)
87 EH (a)\1{1,2} aabc (0,2)(0,1)
88 EH ((.*)\1)+ aa ESUBREG
89 EH ()(\1\1)* NULL (0,0)(0,0)(0,0)
90 # Check that back references work with REG_NOSUB
92 EH (o)\1 foobar (1,3)(1,2)
95 EH \1foo(bar) x ESUBREG
96 # Back reference with zero-width assertion
97 EH (.)\1$ foox NOMATCH
98 EH SAME foo (1,3)(1,2)
99 # Back references together with {}
100 EH ([0-9]{5})\1 12345 NOMATCH
101 EH SAME 1234512345 (0,10)(0,5)
102 EH ([0-9]{4})\1 1234 NOMATCH
103 EH SAME 12341234 (0,8)(0,4)
104 # Test minimal repetitions (non-greedy repetitions)
110 EH .{2,5}? abcd (0,2)
112 EH <b>(.*?)</b> <b>text1</b><b>text2</b> (0,12)(3,8)
113 EH a(.*?)(foo|bar|zap) hubba wooga-booga zabar gafoo wazap (4,23)(5,20)(20,23)
119 EH (a|^b) bas (0,1)(0,1)