pcre-light-0.1: tests/testdata/regex10.tests
testRegex "ERROR" []
["shown when the link size is 2. This is just a doublecheck test to ensure the ",
"sizes don't go horribly wrong when something is changed. The pattern contents ",
"are all themselves checked in other tests. --/"]
[Just ["shown when the link size is 2. This is just a doublecheck test to ensure the "],
Just ["sizes don't go horribly wrong when something is changed. The pattern contents "],
Just ["are all themselves checked in other tests. --/"]]
,
testRegex "((?i)b)" [ERROR]
[]
[Just ["Memory allocation (code space): 21"],
Just ["------------------------------------------------------------------"],
Just [" 10 NC b"],
Just [" 12 9 Ket"],
Just [" 15 00 Opt"],
Just [" 17 17 Ket"],
Just [" 20 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(?s)(.*X|^B)" [ERROR]
[]
[Just ["Memory allocation (code space): 25"],
Just ["------------------------------------------------------------------"],
Just [" 10 X"],
Just [" 12 6 Alt"],
Just [" 15 ^"],
Just [" 16 B"],
Just [" 18 15 Ket"],
Just [" 21 21 Ket"],
Just [" 24 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(?s:.*X|^B)" [ERROR]
[]
[Just ["Memory allocation (code space): 29"],
Just ["------------------------------------------------------------------"],
Just [" 10 X"],
Just [" 12 8 Alt"],
Just [" 15 04 Opt"],
Just [" 17 ^"],
Just [" 18 B"],
Just [" 20 17 Ket"],
Just [" 23 00 Opt"],
Just [" 25 25 Ket"],
Just [" 28 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "^[[:alnum:]]" [ERROR]
[]
[Just ["Memory allocation (code space): 41"],
Just ["------------------------------------------------------------------"],
Just [" 37 37 Ket"],
Just [" 40 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "#" [ERROR]
[]
[Just ["Memory allocation (code space): 7"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"],
Just ["Capturing subpattern count = 0"],
Just ["Options: extended"],
Just ["No first char"],
Just ["No need char"]]
,
testRegex "a#" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"],
Just ["Capturing subpattern count = 0"],
Just ["Options: extended"],
Just ["First char = 'a'"],
Just ["No need char"]]
,
testRegex "x?+" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "x++" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "x{1,3}+" [ERROR]
[]
[Just ["Memory allocation (code space): 19"],
Just ["------------------------------------------------------------------"],
Just [" 12 9 Ket"],
Just [" 15 15 Ket"],
Just [" 18 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(x)*+" [ERROR]
[]
[Just ["Memory allocation (code space): 24"],
Just ["------------------------------------------------------------------"],
Just [" 12 x"],
Just [" 14 7 KetRmax"],
Just [" 17 14 Ket"],
Just [" 20 20 Ket"],
Just [" 23 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "^((a+)(?U)([ab]+)(?-U)([bc]+)(\\w*))" [ERROR]
[]
[Just ["Memory allocation (code space): 120"],
Just ["------------------------------------------------------------------"],
Just [" 14 a+"],
Just [" 16 7 Ket"],
Just [" 19 39 CBra 3"],
Just [" 24 [ab]+?"],
Just [" 58 39 Ket"],
Just [" 61 39 CBra 4"],
Just [" 66 [bc]+"],
Just ["100 39 Ket"],
Just ["103 7 CBra 5"],
Just ["108 \\w*"],
Just ["110 7 Ket"],
Just ["113 109 Ket"],
Just ["116 116 Ket"],
Just ["119 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "ERROR" []
[]
[Just ["Memory allocation (code space): 826"],
Just ["------------------------------------------------------------------"],
Just ["821 \\b"],
Just ["822 822 Ket"],
Just ["825 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "ERROR" []
[]
[Just ["Memory allocation (code space): 816"],
Just ["------------------------------------------------------------------"],
Just ["811 \\b"],
Just ["812 812 Ket"],
Just ["815 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(a(?1)b)" [ERROR]
[]
[Just ["Memory allocation (code space): 28"],
Just ["------------------------------------------------------------------"],
Just [" 10 6 Once"],
Just [" 13 3 Recurse"],
Just [" 16 6 Ket"],
Just [" 19 b"],
Just [" 21 18 Ket"],
Just [" 24 24 Ket"],
Just [" 27 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(a(?1)+b)" [ERROR]
[]
[Just ["Memory allocation (code space): 28"],
Just ["------------------------------------------------------------------"],
Just [" 10 6 Once"],
Just [" 13 3 Recurse"],
Just [" 16 6 KetRmax"],
Just [" 19 b"],
Just [" 21 18 Ket"],
Just [" 24 24 Ket"],
Just [" 27 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "a(?P<name1>b|c)d(?P<longername2>e)" [ERROR]
[]
[Just ["Memory allocation (code space): 42"],
Just ["------------------------------------------------------------------"],
Just [" 10 b"],
Just [" 12 5 Alt"],
Just [" 15 c"],
Just [" 17 12 Ket"],
Just [" 20 d"],
Just [" 22 7 CBra 2"],
Just [" 27 e"],
Just [" 29 7 Ket"],
Just [" 32 32 Ket"],
Just [" 35 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(?:a(?P<c>c(?P<d>d)))(?P<a>a)" [ERROR]
[]
[Just ["Memory allocation (code space): 54"],
Just ["------------------------------------------------------------------"],
Just [" 13 c"],
Just [" 15 7 CBra 2"],
Just [" 20 d"],
Just [" 22 7 Ket"],
Just [" 25 17 Ket"],
Just [" 28 25 Ket"],
Just [" 31 7 CBra 3"],
Just [" 36 a"],
Just [" 38 7 Ket"],
Just [" 41 41 Ket"],
Just [" 44 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "(?P<a>a)...(?P=a)bbb(?P>a)d" [ERROR]
[]
[Just ["Memory allocation (code space): 43"],
Just ["------------------------------------------------------------------"],
Just [" 10 7 Ket"],
Just [" 13 Any"],
Just [" 14 Any"],
Just [" 15 Any"],
Just [" 16 \\1"],
Just [" 19 bbb"],
Just [" 25 6 Once"],
Just [" 28 3 Recurse"],
Just [" 31 6 Ket"],
Just [" 34 d"],
Just [" 36 36 Ket"],
Just [" 39 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "abc(?C255)de(?C)f" [ERROR]
[]
[Just ["Memory allocation (code space): 31"],
Just ["------------------------------------------------------------------"],
Just [" 15 de"],
Just [" 19 Callout 0 16 1"],
Just [" 25 f"],
Just [" 27 27 Ket"],
Just [" 30 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "abcde" [ERROR]
[]
[Just ["Memory allocation (code space): 53"],
Just ["------------------------------------------------------------------"],
Just [" 11 Callout 255 1 1"],
Just [" 17 b"],
Just [" 19 Callout 255 2 1"],
Just [" 25 c"],
Just [" 27 Callout 255 3 1"],
Just [" 33 d"],
Just [" 35 Callout 255 4 1"],
Just [" 41 e"],
Just [" 43 Callout 255 5 0"],
Just [" 49 49 Ket"],
Just [" 52 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{100}" [ERROR]
[]
[Just ["Memory allocation (code space): 10"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{1000}" [ERROR]
[]
[Just ["Memory allocation (code space): 11"],
Just ["------------------------------------------------------------------"],
Just [" 10 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{10000}" [ERROR]
[]
[Just ["Memory allocation (code space): 12"],
Just ["------------------------------------------------------------------"],
Just [" 11 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{100000}" [ERROR]
[]
[Just ["Memory allocation (code space): 12"],
Just ["------------------------------------------------------------------"],
Just [" 11 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{1000000}" [ERROR]
[]
[Just ["Memory allocation (code space): 13"],
Just ["------------------------------------------------------------------"],
Just [" 12 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{4000000}" [ERROR]
[]
[Just ["Memory allocation (code space): 14"],
Just ["------------------------------------------------------------------"],
Just [" 10 10 Ket"],
Just [" 13 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{7fffFFFF}" [ERROR]
[]
[Just ["Memory allocation (code space): 14"],
Just ["------------------------------------------------------------------"],
Just [" 10 10 Ket"],
Just [" 13 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\x{ff}]" [ERROR]
[]
[Just ["Memory allocation (code space): 10"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\x{100}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x80" [ERROR]
[]
[Just ["Memory allocation (code space): 10"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\xff" [ERROR]
[]
[Just ["Memory allocation (code space): 10"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "\\x{0041}\\x{2262}\\x{0391}\\x{002e}" [ERROR]
["",
"/\\x{D55c}\\x{ad6d}\\x{C5B4}/D8M "]
[Just ["Memory allocation (code space): 18"],
Just ["------------------------------------------------------------------"],
Just [" 14 14 Ket"],
Just [" 17 End"],
Just ["------------------------------------------------------------------"],
Just ["Capturing subpattern count = 0"],
Just ["Options: utf8"],
Just ["First char = 'A'"],
Just ["Need char = '.'"],
Just ["/\\x{D55c}\\x{ad6d}\\x{C5B4}/D8M "],
Just ["Memory allocation (code space): 19"],
Just ["------------------------------------------------------------------"],
Just [" 15 15 Ket"],
Just [" 18 End"],
Just ["------------------------------------------------------------------"],
Just ["Capturing subpattern count = 0"],
Just ["Options: utf8"],
Just ["First char = 237"],
Just ["Need char = 180"]]
,
testRegex "\\x{65e5}\\x{672c}\\x{8a9e}" [ERROR]
[]
[Just ["Memory allocation (code space): 19"],
Just ["------------------------------------------------------------------"],
Just [" 15 15 Ket"],
Just [" 18 End"],
Just ["------------------------------------------------------------------"],
Just ["Capturing subpattern count = 0"],
Just ["Options: utf8"],
Just ["First char = 230"],
Just ["Need char = 158"]]
,
testRegex "[\\x{100}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[Z\\x{100}]" [ERROR]
[]
[Just ["Memory allocation (code space): 47"],
Just ["------------------------------------------------------------------"],
Just [" 43 43 Ket"],
Just [" 46 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "^[\\x{100}\\E-\\Q\\E\\x{150}]" [ERROR]
[]
[Just ["Memory allocation (code space): 18"],
Just ["------------------------------------------------------------------"],
Just [" 14 14 Ket"],
Just [" 17 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "^[\\Q\196\128\\E-\\Q\197\144\\E]" [ERROR]
[]
[Just ["Memory allocation (code space): 18"],
Just ["------------------------------------------------------------------"],
Just [" 14 14 Ket"],
Just [" 17 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "^[\\Q\196\128\\E-\\Q\197\144\\E" [ERROR]
[]
[Just ["Failed: missing terminating ] for character class at offset 15"]]
,
testRegex "[\\p{L}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\p{^L}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\P{L}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\P{^L}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[abc\\p{L}\\x{0660}]" [ERROR]
[]
[Just ["Memory allocation (code space): 50"],
Just ["------------------------------------------------------------------"],
Just [" 46 46 Ket"],
Just [" 49 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\p{Nd}]" [ERROR]
[]
[Just ["Memory allocation (code space): 15"],
Just ["------------------------------------------------------------------"],
Just [" 11 11 Ket"],
Just [" 14 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\p{Nd}+-]+" [ERROR]
[]
[Just ["Memory allocation (code space): 48"],
Just ["------------------------------------------------------------------"],
Just [" 44 44 Ket"],
Just [" 47 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "A\\x{391}\\x{10427}\\x{ff3a}\\x{1fb0}" [ERROR]
[]
[Just ["Memory allocation (code space): 25"],
Just ["------------------------------------------------------------------"],
Just [" 21 21 Ket"],
Just [" 24 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "A\\x{391}\\x{10427}\\x{ff3a}\\x{1fb0}" [ERROR]
[]
[Just ["Memory allocation (code space): 25"],
Just ["------------------------------------------------------------------"],
Just [" 21 21 Ket"],
Just [" 24 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\x{105}-\\x{109}]" [ERROR]
[]
[Just ["Memory allocation (code space): 17"],
Just ["------------------------------------------------------------------"],
Just [" 13 13 Ket"],
Just [" 16 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "( ( (?(1)0|) )* )" [ERROR]
[]
[Just ["Memory allocation (code space): 38"],
Just ["------------------------------------------------------------------"],
Just [" 14 8 Cond"],
Just [" 17 1 Cond ref"],
Just [" 20 0"],
Just [" 22 3 Alt"],
Just [" 25 11 Ket"],
Just [" 28 19 KetRmax"],
Just [" 31 28 Ket"],
Just [" 34 34 Ket"],
Just [" 37 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "( (?(1)0|)* )" [ERROR]
[]
[Just ["Memory allocation (code space): 30"],
Just ["------------------------------------------------------------------"],
Just [" 12 1 Cond ref"],
Just [" 15 0"],
Just [" 17 3 Alt"],
Just [" 20 11 KetRmax"],
Just [" 23 20 Ket"],
Just [" 26 26 Ket"],
Just [" 29 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[a]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[a]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\xaa]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[\\xaa]" [ERROR]
[]
[Just ["Memory allocation (code space): 10"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[^a]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[^a]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[^\\xaa]" [ERROR]
[]
[Just ["Memory allocation (code space): 9"],
Just ["------------------------------------------------------------------"],
Just ["------------------------------------------------------------------"]]
,
testRegex "[^\\xaa]" [ERROR]
[]
[Just ["Memory allocation (code space): 40"],
Just ["------------------------------------------------------------------"],
Just [" 36 36 Ket"],
Just [" 39 End"],
Just ["------------------------------------------------------------------"]]
,
testRegex " End of testinput10 " []
[]
[]