diff -U3 /tmp/cirrus-ci-build/src/test/modules/test_regex/expected/test_regex.out /tmp/cirrus-ci-build/build-32/testrun/test_regex/regress/results/test_regex.out --- /tmp/cirrus-ci-build/src/test/modules/test_regex/expected/test_regex.out 2024-11-12 21:06:56.715105653 +0000 +++ /tmp/cirrus-ci-build/build-32/testrun/test_regex/regress/results/test_regex.out 2024-11-12 21:16:57.397310050 +0000 @@ -1010,4075 +1010,7 @@ ERROR: invalid regular expression: invalid character range -- expectMatch 9.15 &LP {[[:<:]]a} a a select * from test_regex('[[:<:]]a', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('[[:<:]]a', 'a', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectMatch 9.16 &LP {a[[:>:]]} a a -select * from test_regex('a[[:>:]]', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('a[[:>:]]', 'a', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectError 9.17 & {a[[..]]b} ECOLLATE -select * from test_regex('a[[..]]b', '', ''); -ERROR: invalid regular expression: invalid collating element -select * from test_regex('a[[..]]b', '', 'b'); -ERROR: invalid regular expression: invalid collating element --- expectError 9.18 & {a[[==]]b} ECOLLATE -select * from test_regex('a[[==]]b', '', ''); -ERROR: invalid regular expression: invalid collating element -select * from test_regex('a[[==]]b', '', 'b'); -ERROR: invalid regular expression: invalid collating element --- expectError 9.19 & {a[[::]]b} ECTYPE -select * from test_regex('a[[::]]b', '', ''); -ERROR: invalid regular expression: invalid character class -select * from test_regex('a[[::]]b', '', 'b'); -ERROR: invalid regular expression: invalid character class --- expectError 9.20 & {a[[.a} EBRACK -select * from test_regex('a[[.a', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[[.a', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.21 & {a[[=a} EBRACK -select * from test_regex('a[[=a', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[[=a', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.22 & {a[[:a} EBRACK -select * from test_regex('a[[:a', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[[:a', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.23 & {a[} EBRACK -select * from test_regex('a[', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.24 & {a[b} EBRACK -select * from test_regex('a[b', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[b', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.25 & {a[b-} EBRACK -select * from test_regex('a[b-', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[b-', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectError 9.26 & {a[b-c} EBRACK -select * from test_regex('a[b-c', '', ''); -ERROR: invalid regular expression: brackets [] not balanced -select * from test_regex('a[b-c', '', 'b'); -ERROR: invalid regular expression: brackets [] not balanced --- expectMatch 9.27 &M {a[b-c]} ab ab -select * from test_regex('a[b-c]', 'ab', 'M'); - test_regex ------------------ - {0,REG_UUNPORT} - {ab} -(2 rows) - -select * from test_regex('a[b-c]', 'ab', 'Mb'); - test_regex ------------------ - {0,REG_UUNPORT} - {ab} -(2 rows) - --- expectMatch 9.28 & {a[b-b]} ab ab -select * from test_regex('a[b-b]', 'ab', ''); - test_regex ------------- - {0} - {ab} -(2 rows) - -select * from test_regex('a[b-b]', 'ab', 'b'); - test_regex ------------- - {0} - {ab} -(2 rows) - --- expectMatch 9.29 &M {a[1-2]} a2 a2 -select * from test_regex('a[1-2]', 'a2', 'M'); - test_regex ------------------ - {0,REG_UUNPORT} - {a2} -(2 rows) - -select * from test_regex('a[1-2]', 'a2', 'Mb'); - test_regex ------------------ - {0,REG_UUNPORT} - {a2} -(2 rows) - --- expectError 9.30 & {a[c-b]} ERANGE -select * from test_regex('a[c-b]', '', ''); -ERROR: invalid regular expression: invalid character range -select * from test_regex('a[c-b]', '', 'b'); -ERROR: invalid regular expression: invalid character range --- expectError 9.31 & {a[a-b-c]} ERANGE -select * from test_regex('a[a-b-c]', '', ''); -ERROR: invalid regular expression: invalid character range -select * from test_regex('a[a-b-c]', '', 'b'); -ERROR: invalid regular expression: invalid character range --- expectMatch 9.32 &M {a[--?]b} a?b a?b -select * from test_regex('a[--?]b', 'a?b', 'M'); - test_regex ------------------ - {0,REG_UUNPORT} - {a?b} -(2 rows) - -select * from test_regex('a[--?]b', 'a?b', 'Mb'); - test_regex ------------------ - {0,REG_UUNPORT} - {a?b} -(2 rows) - --- expectMatch 9.33 & {a[---]b} a-b a-b -select * from test_regex('a[---]b', 'a-b', ''); - test_regex ------------- - {0} - {a-b} -(2 rows) - -select * from test_regex('a[---]b', 'a-b', 'b'); - test_regex ------------- - {0} - {a-b} -(2 rows) - --- expectMatch 9.34 & {a[]b]c} a]c a]c -select * from test_regex('a[]b]c', 'a]c', ''); - test_regex ------------- - {0} - {a]c} -(2 rows) - -select * from test_regex('a[]b]c', 'a]c', 'b'); - test_regex ------------- - {0} - {a]c} -(2 rows) - --- expectMatch 9.35 EP {a[\]]b} a]b a]b -select * from test_regex('a[\]]b', 'a]b', 'EP'); - test_regex ----------------------------- - {0,REG_UBBS,REG_UNONPOSIX} - {a]b} -(2 rows) - --- expectNomatch 9.36 bE {a[\]]b} a]b -select * from test_regex('a[\]]b', 'a]b', 'bE'); - test_regex --------------- - {0,REG_UBBS} -(1 row) - --- expectMatch 9.37 bE {a[\]]b} "a\\]b" "a\\]b" -select * from test_regex('a[\]]b', 'a\]b', 'bE'); - test_regex --------------- - {0,REG_UBBS} - {"a\\]b"} -(2 rows) - --- expectMatch 9.38 eE {a[\]]b} "a\\]b" "a\\]b" -select * from test_regex('a[\]]b', 'a\]b', 'eE'); - test_regex --------------- - {0,REG_UBBS} - {"a\\]b"} -(2 rows) - --- expectMatch 9.39 EP {a[\\]b} "a\\b" "a\\b" -select * from test_regex('a[\\]b', 'a\b', 'EP'); - test_regex ----------------------------- - {0,REG_UBBS,REG_UNONPOSIX} - {"a\\b"} -(2 rows) - --- expectMatch 9.40 eE {a[\\]b} "a\\b" "a\\b" -select * from test_regex('a[\\]b', 'a\b', 'eE'); - test_regex --------------- - {0,REG_UBBS} - {"a\\b"} -(2 rows) - --- expectMatch 9.41 bE {a[\\]b} "a\\b" "a\\b" -select * from test_regex('a[\\]b', 'a\b', 'bE'); - test_regex --------------- - {0,REG_UBBS} - {"a\\b"} -(2 rows) - --- expectError 9.42 - {a[\Z]b} EESCAPE -select * from test_regex('a[\Z]b', '', '-'); -ERROR: invalid regular expression: invalid escape \ sequence --- expectMatch 9.43 & {a[[b]c} "a\[c" "a\[c" -select * from test_regex('a[[b]c', 'a[c', ''); - test_regex ------------- - {0} - {a[c} -(2 rows) - -select * from test_regex('a[[b]c', 'a[c', 'b'); - test_regex ------------- - {0} - {a[c} -(2 rows) - --- This only works in UTF8 encoding, so it's moved to test_regex_utf8.sql: --- expectMatch 9.44 EMP* {a[\u00fe-\u0507][\u00ff-\u0300]b} \ --- "a\u0102\u02ffb" "a\u0102\u02ffb" --- doing 10 "anchors and newlines" --- expectMatch 10.1 & ^a a a -select * from test_regex('^a', 'a', ''); - test_regex ------------- - {0} - {a} -(2 rows) - -select * from test_regex('^a', 'a', 'b'); - test_regex ------------- - {0} - {a} -(2 rows) - --- expectNomatch 10.2 &^ ^a a -select * from test_regex('^a', 'a', '^'); - test_regex ------------- - {0} -(1 row) - -select * from test_regex('^a', 'a', '^b'); - test_regex ------------- - {0} -(1 row) - --- expectIndices 10.3 &N ^ a {0 -1} -select * from test_regex('^', 'a', '0N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"0 -1"} -(2 rows) - -select * from test_regex('^', 'a', '0Nb'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"0 -1"} -(2 rows) - --- expectIndices 10.4 & {a$} aba {2 2} -select * from test_regex('a$', 'aba', '0'); - test_regex ------------- - {0} - {"2 2"} -(2 rows) - -select * from test_regex('a$', 'aba', '0b'); - test_regex ------------- - {0} - {"2 2"} -(2 rows) - --- expectNomatch 10.5 {&$} {a$} a -select * from test_regex('a$', 'a', '$'); - test_regex ------------- - {0} -(1 row) - -select * from test_regex('a$', 'a', '$b'); - test_regex ------------- - {0} -(1 row) - --- expectIndices 10.6 &N {$} ab {2 1} -select * from test_regex('$', 'ab', '0N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"2 1"} -(2 rows) - -select * from test_regex('$', 'ab', '0Nb'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"2 1"} -(2 rows) - --- expectMatch 10.7 &n ^a a a -select * from test_regex('^a', 'a', 'n'); - test_regex ------------- - {0} - {a} -(2 rows) - -select * from test_regex('^a', 'a', 'nb'); - test_regex ------------- - {0} - {a} -(2 rows) - --- expectMatch 10.8 &n "^a" "b\na" "a" -select * from test_regex('^a', E'b\na', 'n'); - test_regex ------------- - {0} - {a} -(2 rows) - -select * from test_regex('^a', E'b\na', 'nb'); - test_regex ------------- - {0} - {a} -(2 rows) - --- expectIndices 10.9 &w "^a" "a\na" {0 0} -select * from test_regex('^a', E'a\na', '0w'); - test_regex ------------- - {0} - {"0 0"} -(2 rows) - -select * from test_regex('^a', E'a\na', '0wb'); - test_regex ------------- - {0} - {"0 0"} -(2 rows) - --- expectIndices 10.10 &n^ "^a" "a\na" {2 2} -select * from test_regex('^a', E'a\na', '0n^'); - test_regex ------------- - {0} - {"2 2"} -(2 rows) - -select * from test_regex('^a', E'a\na', '0n^b'); - test_regex ------------- - {0} - {"2 2"} -(2 rows) - --- expectMatch 10.11 &n {a$} a a -select * from test_regex('a$', 'a', 'n'); - test_regex ------------- - {0} - {a} -(2 rows) - -select * from test_regex('a$', 'a', 'nb'); - test_regex ------------- - {0} - {a} -(2 rows) - --- expectMatch 10.12 &n "a\$" "a\nb" "a" -select * from test_regex('a$', E'a\nb', 'n'); - test_regex ------------- - {0} - {a} -(2 rows) - -select * from test_regex('a$', E'a\nb', 'nb'); - test_regex ------------- - {0} - {a} -(2 rows) - --- expectIndices 10.13 &n "a\$" "a\na" {0 0} -select * from test_regex('a$', E'a\na', '0n'); - test_regex ------------- - {0} - {"0 0"} -(2 rows) - -select * from test_regex('a$', E'a\na', '0nb'); - test_regex ------------- - {0} - {"0 0"} -(2 rows) - --- expectIndices 10.14 N ^^ a {0 -1} -select * from test_regex('^^', 'a', '0N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"0 -1"} -(2 rows) - --- expectMatch 10.15 b ^^ ^ ^ -select * from test_regex('^^', '^', 'b'); - test_regex ------------- - {0} - {^} -(2 rows) - --- expectIndices 10.16 N {$$} a {1 0} -select * from test_regex('$$', 'a', '0N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"1 0"} -(2 rows) - --- expectMatch 10.17 b {$$} "\$" "\$" -select * from test_regex('$$', '$', 'b'); - test_regex ------------- - {0} - {$} -(2 rows) - --- expectMatch 10.18 &N {^$} "" "" -select * from test_regex('^$', '', 'N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {""} -(2 rows) - -select * from test_regex('^$', '', 'Nb'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {""} -(2 rows) - --- expectNomatch 10.19 &N {^$} a -select * from test_regex('^$', 'a', 'N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} -(1 row) - -select * from test_regex('^$', 'a', 'Nb'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} -(1 row) - --- expectIndices 10.20 &nN "^\$" a\n\nb {2 1} -select * from test_regex('^$', E'a\n\nb', '0nN'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"2 1"} -(2 rows) - -select * from test_regex('^$', E'a\n\nb', '0nNb'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {"2 1"} -(2 rows) - --- expectMatch 10.21 N {$^} "" "" -select * from test_regex('$^', '', 'N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {""} -(2 rows) - --- expectMatch 10.22 b {$^} "\$^" "\$^" -select * from test_regex('$^', '$^', 'b'); - test_regex ------------- - {0} - {$^} -(2 rows) - --- expectMatch 10.23 P {\Aa} a a -select * from test_regex('\Aa', 'a', 'P'); - test_regex -------------------- - {0,REG_UNONPOSIX} - {a} -(2 rows) - --- expectMatch 10.24 ^P {\Aa} a a -select * from test_regex('\Aa', 'a', '^P'); - test_regex -------------------- - {0,REG_UNONPOSIX} - {a} -(2 rows) - --- expectNomatch 10.25 ^nP {\Aa} "b\na" -select * from test_regex('\Aa', E'b\na', '^nP'); - test_regex -------------------- - {0,REG_UNONPOSIX} -(1 row) - --- expectMatch 10.26 P {a\Z} a a -select * from test_regex('a\Z', 'a', 'P'); - test_regex -------------------- - {0,REG_UNONPOSIX} - {a} -(2 rows) - --- expectMatch 10.27 \$P {a\Z} a a -select * from test_regex('a\Z', 'a', '$P'); - test_regex -------------------- - {0,REG_UNONPOSIX} - {a} -(2 rows) - --- expectNomatch 10.28 \$nP {a\Z} "a\nb" -select * from test_regex('a\Z', E'a\nb', '$nP'); - test_regex -------------------- - {0,REG_UNONPOSIX} -(1 row) - --- expectError 10.29 - ^* BADRPT -select * from test_regex('^*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 10.30 - {$*} BADRPT -select * from test_regex('$*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 10.31 - {\A*} BADRPT -select * from test_regex('\A*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 10.32 - {\Z*} BADRPT -select * from test_regex('\Z*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- doing 11 "boundary constraints" --- expectMatch 11.1 &LP {[[:<:]]a} a a -select * from test_regex('[[:<:]]a', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('[[:<:]]a', 'a', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectMatch 11.2 &LP {[[:<:]]a} -a a -select * from test_regex('[[:<:]]a', '-a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('[[:<:]]a', '-a', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.3 &LP {[[:<:]]a} ba -select * from test_regex('[[:<:]]a', 'ba', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - -select * from test_regex('[[:<:]]a', 'ba', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.4 &LP {a[[:>:]]} a a -select * from test_regex('a[[:>:]]', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('a[[:>:]]', 'a', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectMatch 11.5 &LP {a[[:>:]]} a- a -select * from test_regex('a[[:>:]]', 'a-', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('a[[:>:]]', 'a-', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.6 &LP {a[[:>:]]} ab -select * from test_regex('a[[:>:]]', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - -select * from test_regex('a[[:>:]]', 'ab', 'LPb'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.7 bLP {\} a a -select * from test_regex('a\>', 'a', 'bLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.10 bLP {a\>} ab -select * from test_regex('a\>', 'ab', 'bLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.11 LP {\ya} a a -select * from test_regex('\ya', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.12 LP {\ya} ba -select * from test_regex('\ya', 'ba', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.13 LP {a\y} a a -select * from test_regex('a\y', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.14 LP {a\y} ab -select * from test_regex('a\y', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.15 LP {a\Y} ab a -select * from test_regex('a\Y', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.16 LP {a\Y} a- -select * from test_regex('a\Y', 'a-', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectNomatch 11.17 LP {a\Y} a -select * from test_regex('a\Y', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectNomatch 11.18 LP {-\Y} -a -select * from test_regex('-\Y', '-a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.19 LP {-\Y} -% - -select * from test_regex('-\Y', '-%', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {-} -(2 rows) - --- expectNomatch 11.20 LP {\Y-} a- -select * from test_regex('\Y-', 'a-', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectError 11.21 - {[[:<:]]*} BADRPT -select * from test_regex('[[:<:]]*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 11.22 - {[[:>:]]*} BADRPT -select * from test_regex('[[:>:]]*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 11.23 b {\<*} BADRPT -select * from test_regex('\<*', '', 'b'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 11.24 b {\>*} BADRPT -select * from test_regex('\>*', '', 'b'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 11.25 - {\y*} BADRPT -select * from test_regex('\y*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectError 11.26 - {\Y*} BADRPT -select * from test_regex('\Y*', '', '-'); -ERROR: invalid regular expression: quantifier operand invalid --- expectMatch 11.27 LP {\ma} a a -select * from test_regex('\ma', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.28 LP {\ma} ba -select * from test_regex('\ma', 'ba', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 11.29 LP {a\M} a a -select * from test_regex('a\M', 'a', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - --- expectNomatch 11.30 LP {a\M} ab -select * from test_regex('a\M', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectNomatch 11.31 ILP {\Ma} a -select * from test_regex('\Ma', 'a', 'ILP'); - test_regex ------------------------------------------------ - {0,REG_UNONPOSIX,REG_ULOCALE,REG_UIMPOSSIBLE} -(1 row) - --- expectNomatch 11.32 ILP {a\m} a -select * from test_regex('a\m', 'a', 'ILP'); - test_regex ------------------------------------------------ - {0,REG_UNONPOSIX,REG_ULOCALE,REG_UIMPOSSIBLE} -(1 row) - --- doing 12 "character classes" --- expectMatch 12.1 LP {a\db} a0b a0b -select * from test_regex('a\db', 'a0b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a0b} -(2 rows) - --- expectNomatch 12.2 LP {a\db} axb -select * from test_regex('a\db', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectNomatch 12.3 LP {a\Db} a0b -select * from test_regex('a\Db', 'a0b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 12.4 LP {a\Db} axb axb -select * from test_regex('a\Db', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {axb} -(2 rows) - --- expectMatch 12.5 LP "a\\sb" "a b" "a b" -select * from test_regex('a\sb', 'a b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"a b"} -(2 rows) - --- expectMatch 12.6 LP "a\\sb" "a\tb" "a\tb" -select * from test_regex('a\sb', E'a\tb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"a b"} -(2 rows) - --- expectMatch 12.7 LP "a\\sb" "a\nb" "a\nb" -select * from test_regex('a\sb', E'a\nb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"a + - b"} -(2 rows) - --- expectNomatch 12.8 LP {a\sb} axb -select * from test_regex('a\sb', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 12.9 LP {a\Sb} axb axb -select * from test_regex('a\Sb', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {axb} -(2 rows) - --- expectNomatch 12.10 LP "a\\Sb" "a b" -select * from test_regex('a\Sb', 'a b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 12.11 LP {a\wb} axb axb -select * from test_regex('a\wb', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {axb} -(2 rows) - --- expectNomatch 12.12 LP {a\wb} a-b -select * from test_regex('a\wb', 'a-b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectNomatch 12.13 LP {a\Wb} axb -select * from test_regex('a\Wb', 'axb', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- expectMatch 12.14 LP {a\Wb} a-b a-b -select * from test_regex('a\Wb', 'a-b', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {a-b} -(2 rows) - --- expectMatch 12.15 LP {\y\w+z\y} adze-guz guz -select * from test_regex('\y\w+z\y', 'adze-guz', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {guz} -(2 rows) - --- expectMatch 12.16 LPE {a[\d]b} a1b a1b -select * from test_regex('a[\d]b', 'a1b', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {a1b} -(2 rows) - --- expectMatch 12.17 LPE "a\[\\s]b" "a b" "a b" -select * from test_regex('a[\s]b', 'a b', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {"a b"} -(2 rows) - --- expectMatch 12.18 LPE {a[\w]b} axb axb -select * from test_regex('a[\w]b', 'axb', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {axb} -(2 rows) - --- these should be invalid -select * from test_regex('[\w-~]*', 'ab01_~-`**', 'LNPSE'); -ERROR: invalid regular expression: invalid character range -select * from test_regex('[~-\w]*', 'ab01_~-`**', 'LNPSE'); -ERROR: invalid regular expression: invalid character range -select * from test_regex('[[:alnum:]-~]*', 'ab01~-`**', 'LNS'); -ERROR: invalid regular expression: invalid character range -select * from test_regex('[~-[:alnum:]]*', 'ab01~-`**', 'LNS'); -ERROR: invalid regular expression: invalid character range --- test complemented char classes within brackets -select * from test_regex('[\D]', '0123456789abc*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('[^\D]', 'abc0123456789*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {0} -(2 rows) - -select * from test_regex('[1\D7]', '0123456789abc*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {1} -(2 rows) - -select * from test_regex('[7\D1]', '0123456789abc*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {1} -(2 rows) - -select * from test_regex('[^0\D1]', 'abc0123456789*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {2} -(2 rows) - -select * from test_regex('[^1\D0]', 'abc0123456789*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {2} -(2 rows) - -select * from test_regex('\W', '0123456789abc_*', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {*} -(2 rows) - -select * from test_regex('[\W]', '0123456789abc_*', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {*} -(2 rows) - -select * from test_regex('[\s\S]*', '012 3456789abc_*', 'LNPE'); - test_regex --------------------------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE,REG_UEMPTYMATCH} - {"012 3456789abc_*"} -(2 rows) - --- check char classes' handling of newlines -select * from test_regex('\s+', E'abc \n def', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {" + - "} -(2 rows) - -select * from test_regex('\s+', E'abc \n def', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {" + - "} -(2 rows) - -select * from test_regex('[\s]+', E'abc \n def', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {" + - "} -(2 rows) - -select * from test_regex('[\s]+', E'abc \n def', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {" + - "} -(2 rows) - -select * from test_regex('\S+', E'abc\ndef', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {abc} -(2 rows) - -select * from test_regex('\S+', E'abc\ndef', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {abc} -(2 rows) - -select * from test_regex('[\S]+', E'abc\ndef', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {abc} -(2 rows) - -select * from test_regex('[\S]+', E'abc\ndef', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {abc} -(2 rows) - -select * from test_regex('\d+', E'012\n345', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {012} -(2 rows) - -select * from test_regex('\d+', E'012\n345', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {012} -(2 rows) - -select * from test_regex('[\d]+', E'012\n345', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {012} -(2 rows) - -select * from test_regex('[\d]+', E'012\n345', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {012} -(2 rows) - -select * from test_regex('\D+', E'abc\ndef345', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"abc + - def"} -(2 rows) - -select * from test_regex('\D+', E'abc\ndef345', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"abc + - def"} -(2 rows) - -select * from test_regex('[\D]+', E'abc\ndef345', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {"abc + - def"} -(2 rows) - -select * from test_regex('[\D]+', E'abc\ndef345', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {"abc + - def"} -(2 rows) - -select * from test_regex('\w+', E'abc_012\ndef', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {abc_012} -(2 rows) - -select * from test_regex('\w+', E'abc_012\ndef', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {abc_012} -(2 rows) - -select * from test_regex('[\w]+', E'abc_012\ndef', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {abc_012} -(2 rows) - -select * from test_regex('[\w]+', E'abc_012\ndef', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {abc_012} -(2 rows) - -select * from test_regex('\W+', E'***\n@@@___', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"*** + - @@@"} -(2 rows) - -select * from test_regex('\W+', E'***\n@@@___', 'nLP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"*** + - @@@"} -(2 rows) - -select * from test_regex('[\W]+', E'***\n@@@___', 'LPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {"*** + - @@@"} -(2 rows) - -select * from test_regex('[\W]+', E'***\n@@@___', 'nLPE'); - test_regex ----------------------------------------- - {0,REG_UBBS,REG_UNONPOSIX,REG_ULOCALE} - {"*** + - @@@"} -(2 rows) - --- doing 13 "escapes" --- expectError 13.1 & "a\\" EESCAPE -select * from test_regex('a\', '', ''); -ERROR: invalid regular expression: invalid escape \ sequence -select * from test_regex('a\', '', 'b'); -ERROR: invalid regular expression: invalid escape \ sequence --- expectMatch 13.2 - {a\]+)>} a --- } 1 -select * from test_regex('\A\s*[^<]*\s*<([^>]+)>', 'a', 'LP'); - test_regex -------------------------------- - {1,REG_UNONPOSIX,REG_ULOCALE} - {a,a} -(2 rows) - --- test reg-33.4 {Bug 505048} { --- regexp {\A\s*([^b]*)b} ab --- } 1 -select * from test_regex('\A\s*([^b]*)b', 'ab', 'LP'); - test_regex -------------------------------- - {1,REG_UNONPOSIX,REG_ULOCALE} - {ab,a} -(2 rows) - --- test reg-33.5 {Bug 505048} { --- regexp {\A\s*[^b]*(b)} ab --- } 1 -select * from test_regex('\A\s*[^b]*(b)', 'ab', 'LP'); - test_regex -------------------------------- - {1,REG_UNONPOSIX,REG_ULOCALE} - {ab,b} -(2 rows) - --- test reg-33.6 {Bug 505048} { --- regexp {\A(\s*)[^b]*(b)} ab --- } 1 -select * from test_regex('\A(\s*)[^b]*(b)', 'ab', 'LP'); - test_regex -------------------------------- - {2,REG_UNONPOSIX,REG_ULOCALE} - {ab,"",b} -(2 rows) - --- test reg-33.7 {Bug 505048} { --- regexp {\A\s*[^b]*b} ab --- } 1 -select * from test_regex('\A\s*[^b]*b', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {ab} -(2 rows) - --- test reg-33.8 {Bug 505048} { --- regexp -inline {\A\s*[^b]*b} ab --- } ab -select * from test_regex('\A\s*[^b]*b', 'ab', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {ab} -(2 rows) - --- test reg-33.9 {Bug 505048} { --- regexp -indices -inline {\A\s*[^b]*b} ab --- } {{0 1}} -select * from test_regex('\A\s*[^b]*b', 'ab', '0LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {"0 1"} -(2 rows) - --- test reg-33.10 {Bug 840258} -body { --- regsub {(^|\n)+\.*b} \n.b {} tmp --- } -cleanup { --- unset tmp --- } -result 1 -select * from test_regex('(^|\n)+\.*b', E'\n.b', 'P'); - test_regex -------------------- - {1,REG_UNONPOSIX} - {" + - .b"," + - "} -(2 rows) - --- test reg-33.11 {Bug 840258} -body { --- regsub {(^|[\n\r]+)\.*\?<.*?(\n|\r)+} \ --- "TQ\r\n.?<5000267>Test already stopped\r\n" {} tmp --- } -cleanup { --- unset tmp --- } -result 1 -select * from test_regex('(^|[\n\r]+)\.*\?<.*?(\n|\r)+', E'TQ\r\n.?<5000267>Test already stopped\r\n', 'EP'); - test_regex ------------------------------------ - {2,REG_UBBS,REG_UNONPOSIX} - {"\r + - .?<5000267>Test already stopped\r+ - ","\r + - "," + - "} -(2 rows) - --- test reg-33.12 {Bug 1810264 - bad read} { --- regexp {\3161573148} {\3161573148} --- } 0 -select * from test_regex('\3161573148', '\3161573148', 'MP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_UUNPORT} -(1 row) - --- test reg-33.13 {Bug 1810264 - infinite loop} { --- regexp {($|^)*} {x} --- } 1 -select * from test_regex('($|^)*', 'x', 'N'); - test_regex ---------------------- - {1,REG_UEMPTYMATCH} - {"",""} -(2 rows) - --- # Some environments have small default stack sizes. [Bug 1905562] --- test reg-33.14 {Bug 1810264 - super-expensive expression} nonPortable { --- regexp {(x{200}){200}$y} {x} --- } 0 --- This might or might not work depending on platform, so skip it --- select * from test_regex('(x{200}){200}$y', 'x', 'IQ'); --- test reg-33.15.1 {Bug 3603557 - an "in the wild" RE} { --- lindex [regexp -expanded -about { --- ^TETRA_MODE_CMD # Message Type --- ([[:blank:]]+) # Pad --- (ETS_1_1|ETS_1_2|ETS_2_2) # SystemCode --- ([[:blank:]]+) # Pad --- (CONTINUOUS|CARRIER|MCCH|TRAFFIC) # SharingMode --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,2}) # ColourCode --- ([[:blank:]]+) # Pad --- (1|2|3|4|6|9|12|18) # TSReservedFrames --- ([[:blank:]]+) # Pad --- (PASS|TRUE|FAIL|FALSE) # UPlaneDTX --- ([[:blank:]]+) # Pad --- (PASS|TRUE|FAIL|FALSE) # Frame18Extension --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,4}) # MCC --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,5}) # MNC --- ([[:blank:]]+) # Pad --- (BOTH|BCAST|ENQRY|NONE) # NbrCellBcast --- ([[:blank:]]+) # Pad --- (UNKNOWN|LOW|MEDIUM|HIGH) # CellServiceLevel --- ([[:blank:]]+) # Pad --- (PASS|TRUE|FAIL|FALSE) # LateEntryInfo --- ([[:blank:]]+) # Pad --- (300|400) # FrequencyBand --- ([[:blank:]]+) # Pad --- (NORMAL|REVERSE) # ReverseOperation --- ([[:blank:]]+) # Pad --- (NONE|\+6\.25|\-6\.25|\+12\.5) # Offset --- ([[:blank:]]+) # Pad --- (10) # DuplexSpacing --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,4}) # MainCarrierNr --- ([[:blank:]]+) # Pad --- (0|1|2|3) # NrCSCCH --- ([[:blank:]]+) # Pad --- (15|20|25|30|35|40|45) # MSTxPwrMax --- ([[:blank:]]+) # Pad --- (\-125|\-120|\-115|\-110|\-105|\-100|\-95|\-90|\-85|\-80|\-75|\-70|\-65|\-60|\-55|\-50) --- # RxLevAccessMin --- ([[:blank:]]+) # Pad --- (\-53|\-51|\-49|\-47|\-45|\-43|\-41|\-39|\-37|\-35|\-33|\-31|\-29|\-27|\-25|\-23) --- # AccessParameter --- ([[:blank:]]+) # Pad --- (DISABLE|[[:digit:]]{3,4}) # RadioDLTimeout --- ([[:blank:]]+) # Pad --- (\-[[:digit:]]{2,3}) # RSSIThreshold --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,5}) # CCKIdSCKVerNr --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,5}) # LocationArea --- ([[:blank:]]+) # Pad --- ([(1|0)]{16}) # SubscriberClass --- ([[:blank:]]+) # Pad --- ([(1|0)]{12}) # BSServiceDetails --- ([[:blank:]]+) # Pad --- (RANDOMIZE|IMMEDIATE|[[:digit:]]{1,2}) # IMM --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,2}) # WT --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,2}) # Nu --- ([[:blank:]]+) # Pad --- ([0-1]) # FrameLngFctr --- ([[:blank:]]+) # Pad --- ([[:digit:]]{1,2}) # TSPtr --- ([[:blank:]]+) # Pad --- ([0-7]) # MinPriority --- ([[:blank:]]+) # Pad --- (PASS|TRUE|FAIL|FALSE) # ExtdSrvcsEnabled --- ([[:blank:]]+) # Pad --- (.*) # ConditionalFields --- }] 0 --- } 68 -select * from test_regex($$ - ^TETRA_MODE_CMD # Message Type - ([[:blank:]]+) # Pad - (ETS_1_1|ETS_1_2|ETS_2_2) # SystemCode - ([[:blank:]]+) # Pad - (CONTINUOUS|CARRIER|MCCH|TRAFFIC) # SharingMode - ([[:blank:]]+) # Pad - ([[:digit:]]{1,2}) # ColourCode - ([[:blank:]]+) # Pad - (1|2|3|4|6|9|12|18) # TSReservedFrames - ([[:blank:]]+) # Pad - (PASS|TRUE|FAIL|FALSE) # UPlaneDTX - ([[:blank:]]+) # Pad - (PASS|TRUE|FAIL|FALSE) # Frame18Extension - ([[:blank:]]+) # Pad - ([[:digit:]]{1,4}) # MCC - ([[:blank:]]+) # Pad - ([[:digit:]]{1,5}) # MNC - ([[:blank:]]+) # Pad - (BOTH|BCAST|ENQRY|NONE) # NbrCellBcast - ([[:blank:]]+) # Pad - (UNKNOWN|LOW|MEDIUM|HIGH) # CellServiceLevel - ([[:blank:]]+) # Pad - (PASS|TRUE|FAIL|FALSE) # LateEntryInfo - ([[:blank:]]+) # Pad - (300|400) # FrequencyBand - ([[:blank:]]+) # Pad - (NORMAL|REVERSE) # ReverseOperation - ([[:blank:]]+) # Pad - (NONE|\+6\.25|\-6\.25|\+12\.5) # Offset - ([[:blank:]]+) # Pad - (10) # DuplexSpacing - ([[:blank:]]+) # Pad - ([[:digit:]]{1,4}) # MainCarrierNr - ([[:blank:]]+) # Pad - (0|1|2|3) # NrCSCCH - ([[:blank:]]+) # Pad - (15|20|25|30|35|40|45) # MSTxPwrMax - ([[:blank:]]+) # Pad - (\-125|\-120|\-115|\-110|\-105|\-100|\-95|\-90|\-85|\-80|\-75|\-70|\-65|\-60|\-55|\-50) - # RxLevAccessMin - ([[:blank:]]+) # Pad - (\-53|\-51|\-49|\-47|\-45|\-43|\-41|\-39|\-37|\-35|\-33|\-31|\-29|\-27|\-25|\-23) - # AccessParameter - ([[:blank:]]+) # Pad - (DISABLE|[[:digit:]]{3,4}) # RadioDLTimeout - ([[:blank:]]+) # Pad - (\-[[:digit:]]{2,3}) # RSSIThreshold - ([[:blank:]]+) # Pad - ([[:digit:]]{1,5}) # CCKIdSCKVerNr - ([[:blank:]]+) # Pad - ([[:digit:]]{1,5}) # LocationArea - ([[:blank:]]+) # Pad - ([(1|0)]{16}) # SubscriberClass - ([[:blank:]]+) # Pad - ([(1|0)]{12}) # BSServiceDetails - ([[:blank:]]+) # Pad - (RANDOMIZE|IMMEDIATE|[[:digit:]]{1,2}) # IMM - ([[:blank:]]+) # Pad - ([[:digit:]]{1,2}) # WT - ([[:blank:]]+) # Pad - ([[:digit:]]{1,2}) # Nu - ([[:blank:]]+) # Pad - ([0-1]) # FrameLngFctr - ([[:blank:]]+) # Pad - ([[:digit:]]{1,2}) # TSPtr - ([[:blank:]]+) # Pad - ([0-7]) # MinPriority - ([[:blank:]]+) # Pad - (PASS|TRUE|FAIL|FALSE) # ExtdSrvcsEnabled - ([[:blank:]]+) # Pad - (.*) # ConditionalFields - $$, '', 'xLMPQ'); - test_regex --------------------------------------------------------- - {68,REG_UBOUNDS,REG_UNONPOSIX,REG_UUNPORT,REG_ULOCALE} -(1 row) - --- test reg-33.16.1 {Bug [8d2c0da36d]- another "in the wild" RE} { --- lindex [regexp -about "^MRK:client1: =1339 14HKelly Talisman 10011000 (\[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]*) \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 8 0 8 0 0 0 77 77 1 1 2 0 11 { 1 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 13HC6 My Creator 2 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 31HC7 Slightly offensive name, huh 3 8 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 23HE-mail:kelly@hotbox.com 4 9 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 17Hcompface must die 5 10 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 3HAir 6 12 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 14HPGP public key 7 13 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 16Hkelly@hotbox.com 8 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 12H2 text/plain 9 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 13H2 x-kom/basic 10 33 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H0 11 14 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H3 }\r?"] 0 --- } 1 -select * from test_regex(E'^MRK:client1: =1339 14HKelly Talisman 10011000 ([0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]*) [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 8 0 8 0 0 0 77 77 1 1 2 0 11 { 1 3 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 13HC6 My Creator 2 3 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 31HC7 Slightly offensive name, huh 3 8 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 23HE-mail:kelly@hotbox.com 4 9 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 17Hcompface must die 5 10 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 0 3HAir 6 12 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 14HPGP public key 7 13 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 16Hkelly@hotbox.com 8 30 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 0 12H2 text/plain 9 30 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 0 13H2 x-kom/basic 10 33 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 1H0 11 14 8 [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* [0-9]* 00000000 1 1H3 }\r?', '', 'BMS'); - test_regex ------------------------------------------ - {1,REG_UBRACES,REG_UUNSPEC,REG_UUNPORT} -(1 row) - --- test reg-33.15 {constraint fixes} { --- regexp {(^)+^} x --- } 1 -select * from test_regex('(^)+^', 'x', 'N'); - test_regex ---------------------- - {1,REG_UEMPTYMATCH} - {"",""} -(2 rows) - --- test reg-33.16 {constraint fixes} { --- regexp {($^)+} x --- } 0 -select * from test_regex('($^)+', 'x', 'N'); - test_regex ---------------------- - {1,REG_UEMPTYMATCH} -(1 row) - --- test reg-33.17 {constraint fixes} { --- regexp {(^$)*} x --- } 1 -select * from test_regex('(^$)*', 'x', 'N'); - test_regex ---------------------- - {1,REG_UEMPTYMATCH} - {"",NULL} -(2 rows) - --- test reg-33.18 {constraint fixes} { --- regexp {(^(?!aa))+} {aa bb cc} --- } 0 -select * from test_regex('(^(?!aa))+', 'aa bb cc', 'HP'); - test_regex ------------------------------------ - {1,REG_ULOOKAROUND,REG_UNONPOSIX} -(1 row) - --- test reg-33.19 {constraint fixes} { --- regexp {(^(?!aa)(?!bb)(?!cc))+} {aa x} --- } 0 -select * from test_regex('(^(?!aa)(?!bb)(?!cc))+', 'aa x', 'HP'); - test_regex ------------------------------------ - {1,REG_ULOOKAROUND,REG_UNONPOSIX} -(1 row) - --- test reg-33.20 {constraint fixes} { --- regexp {(^(?!aa)(?!bb)(?!cc))+} {bb x} --- } 0 -select * from test_regex('(^(?!aa)(?!bb)(?!cc))+', 'bb x', 'HP'); - test_regex ------------------------------------ - {1,REG_ULOOKAROUND,REG_UNONPOSIX} -(1 row) - --- test reg-33.21 {constraint fixes} { --- regexp {(^(?!aa)(?!bb)(?!cc))+} {cc x} --- } 0 -select * from test_regex('(^(?!aa)(?!bb)(?!cc))+', 'cc x', 'HP'); - test_regex ------------------------------------ - {1,REG_ULOOKAROUND,REG_UNONPOSIX} -(1 row) - --- test reg-33.22 {constraint fixes} { --- regexp {(^(?!aa)(?!bb)(?!cc))+} {dd x} --- } 1 -select * from test_regex('(^(?!aa)(?!bb)(?!cc))+', 'dd x', 'HP'); - test_regex ------------------------------------ - {1,REG_ULOOKAROUND,REG_UNONPOSIX} - {"",""} -(2 rows) - --- test reg-33.23 {} { --- regexp {abcd(\m)+xyz} x --- } 0 -select * from test_regex('abcd(\m)+xyz', 'x', 'ILP'); - test_regex ------------------------------------------------ - {1,REG_UNONPOSIX,REG_ULOCALE,REG_UIMPOSSIBLE} -(1 row) - --- test reg-33.24 {} { --- regexp {abcd(\m)+xyz} a --- } 0 -select * from test_regex('abcd(\m)+xyz', 'a', 'ILP'); - test_regex ------------------------------------------------ - {1,REG_UNONPOSIX,REG_ULOCALE,REG_UIMPOSSIBLE} -(1 row) - --- test reg-33.25 {} { --- regexp {^abcd*(((((^(a c(e?d)a+|)+|)+|)+|)+|a)+|)} x --- } 0 -select * from test_regex('^abcd*(((((^(a c(e?d)a+|)+|)+|)+|)+|a)+|)', 'x', 'S'); - test_regex ------------------ - {7,REG_UUNSPEC} -(1 row) - --- test reg-33.26 {} { --- regexp {a^(^)bcd*xy(((((($a+|)+|)+|)+$|)+|)+|)^$} x --- } 0 -select * from test_regex('a^(^)bcd*xy(((((($a+|)+|)+|)+$|)+|)+|)^$', 'x', 'IS'); - test_regex ---------------------------------- - {7,REG_UUNSPEC,REG_UIMPOSSIBLE} -(1 row) - --- test reg-33.27 {} { --- regexp {xyz(\Y\Y)+} x --- } 0 -select * from test_regex('xyz(\Y\Y)+', 'x', 'LP'); - test_regex -------------------------------- - {1,REG_UNONPOSIX,REG_ULOCALE} -(1 row) - --- test reg-33.28 {} { --- regexp {x|(?:\M)+} x --- } 1 -select * from test_regex('x|(?:\M)+', 'x', 'LNP'); - test_regex ------------------------------------------------ - {0,REG_UNONPOSIX,REG_ULOCALE,REG_UEMPTYMATCH} - {x} -(2 rows) - --- test reg-33.29 {} { --- # This is near the limits of the RE engine --- regexp [string repeat x*y*z* 480] x --- } 1 --- The runtime cost of this seems out of proportion to the value, --- so for Postgres purposes reduce the repeat to 200x -select * from test_regex(repeat('x*y*z*', 200), 'x', 'N'); - test_regex ---------------------- - {0,REG_UEMPTYMATCH} - {x} -(2 rows) - --- test reg-33.30 {Bug 1080042} { --- regexp {(\Y)+} foo --- } 1 -select * from test_regex('(\Y)+', 'foo', 'LNP'); - test_regex ------------------------------------------------ - {1,REG_UNONPOSIX,REG_ULOCALE,REG_UEMPTYMATCH} - {"",""} -(2 rows) - --- and now, tests not from either Spencer or the Tcl project --- These cases exercise additional code paths in pushfwd()/push()/combine() -select * from test_regex('a\Y(?=45)', 'a45', 'HLP'); - test_regex ------------------------------------------------ - {0,REG_ULOOKAROUND,REG_UNONPOSIX,REG_ULOCALE} - {a} -(2 rows) - -select * from test_regex('a(?=.)c', 'ac', 'HP'); - test_regex ------------------------------------ - {0,REG_ULOOKAROUND,REG_UNONPOSIX} - {ac} -(2 rows) - -select * from test_regex('a(?=.).*(?=3)3*', 'azz33', 'HP'); - test_regex ------------------------------------ - {0,REG_ULOOKAROUND,REG_UNONPOSIX} - {azz33} -(2 rows) - -select * from test_regex('a(?=\w)\w*(?=.).*', 'az3%', 'HLP'); - test_regex ------------------------------------------------ - {0,REG_ULOOKAROUND,REG_UNONPOSIX,REG_ULOCALE} - {az3%} -(2 rows) - --- These exercise the bulk-arc-movement paths in moveins() and moveouts(); --- you may need to make them longer if you change BULK_ARC_OP_USE_SORT() -select * from test_regex('ABCDEFGHIJKLMNOPQRSTUVWXYZ(?:\w|a|b|c|d|e|f|0|1|2|3|4|5|6|Q)', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ3', 'LP'); - test_regex -------------------------------- - {0,REG_UNONPOSIX,REG_ULOCALE} - {ABCDEFGHIJKLMNOPQRSTUVWXYZ3} -(2 rows) - -select * from test_regex('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789(\Y\Y)+', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789Z', 'LP'); - test_regex -------------------------------------------- - {1,REG_UNONPOSIX,REG_ULOCALE} - {ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,""} -(2 rows) - -select * from test_regex('((x|xabcdefghijklmnopqrstuvwxyz0123456789)x*|[^y]z)$', - 'az', ''); - test_regex --------------- - {2} - {az,az,NULL} -(2 rows) - +server closed the connection unexpectedly + This probably means the server terminated abnormally + before or while processing the request. +connection to server was lost