2014-10-06 13:28:42 -04:00
|
|
|
# This set of tests is run only with the 8-bit library. It tests the POSIX
|
2015-08-18 06:34:05 -04:00
|
|
|
# interface, which is supported only with the 8-bit library. This test should
|
|
|
|
# not be run with JIT (which is not available for the POSIX interface).
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
#forbid_utf
|
2014-10-06 13:28:42 -04:00
|
|
|
#pattern posix
|
|
|
|
|
2017-05-18 10:21:55 -04:00
|
|
|
# Test some invalid options
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
/abc/auto_callout
|
|
|
|
** Ignored with POSIX interface: auto_callout
|
|
|
|
|
|
|
|
/abc/
|
|
|
|
abc\=find_limits
|
|
|
|
** Ignored with POSIX interface: find_limits
|
|
|
|
0: abc
|
|
|
|
|
|
|
|
/abc/
|
|
|
|
abc\=partial_hard
|
|
|
|
** Ignored with POSIX interface: partial_hard
|
|
|
|
0: abc
|
2017-05-18 10:21:55 -04:00
|
|
|
|
|
|
|
/a(())bc/parens_nest_limit=1
|
|
|
|
** Ignored with POSIX interface: parens_nest_limit
|
|
|
|
|
|
|
|
/abc/allow_surrogate_escapes,max_pattern_length=2
|
|
|
|
** Ignored with POSIX interface: allow_surrogate_escapes max_pattern_length
|
2015-08-18 06:34:05 -04:00
|
|
|
|
|
|
|
# Real tests
|
|
|
|
|
|
|
|
/abc/
|
|
|
|
abc
|
|
|
|
0: abc
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
/^abc|def/
|
|
|
|
abcdef
|
|
|
|
0: abc
|
|
|
|
abcdef\=notbol
|
|
|
|
0: def
|
|
|
|
|
|
|
|
/.*((abc)$|(def))/
|
|
|
|
defabc
|
|
|
|
0: defabc
|
|
|
|
1: abc
|
|
|
|
2: abc
|
|
|
|
defabc\=noteol
|
|
|
|
0: def
|
|
|
|
1: def
|
2018-02-19 09:49:42 -05:00
|
|
|
2: <unset>
|
2015-08-18 06:34:05 -04:00
|
|
|
3: def
|
|
|
|
|
|
|
|
/the quick brown fox/
|
|
|
|
the quick brown fox
|
|
|
|
0: the quick brown fox
|
2015-09-16 12:49:48 -04:00
|
|
|
\= Expect no match
|
2015-08-18 06:34:05 -04:00
|
|
|
The Quick Brown Fox
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
|
|
|
/the quick brown fox/i
|
|
|
|
the quick brown fox
|
|
|
|
0: the quick brown fox
|
|
|
|
The Quick Brown Fox
|
|
|
|
0: The Quick Brown Fox
|
|
|
|
|
2015-09-08 13:01:17 -04:00
|
|
|
/(*LF)abc.def/
|
2015-09-16 12:49:48 -04:00
|
|
|
\= Expect no match
|
2015-08-18 06:34:05 -04:00
|
|
|
abc\ndef
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
2015-09-08 13:01:17 -04:00
|
|
|
/(*LF)abc$/
|
2015-08-18 06:34:05 -04:00
|
|
|
abc
|
|
|
|
0: abc
|
|
|
|
abc\n
|
|
|
|
0: abc
|
|
|
|
|
|
|
|
/(abc)\2/
|
|
|
|
Failed: POSIX code 15: bad back reference at offset 6
|
|
|
|
|
|
|
|
/(abc\1)/
|
2015-09-16 12:49:48 -04:00
|
|
|
\= Expect no match
|
2015-08-18 06:34:05 -04:00
|
|
|
abc
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
|
|
|
/a*(b+)(z)(z)/
|
|
|
|
aaaabbbbzzzz
|
|
|
|
0: aaaabbbbzz
|
|
|
|
1: bbbb
|
|
|
|
2: z
|
|
|
|
3: z
|
|
|
|
aaaabbbbzzzz\=ovector=0
|
|
|
|
Matched without capture
|
|
|
|
aaaabbbbzzzz\=ovector=1
|
|
|
|
0: aaaabbbbzz
|
|
|
|
aaaabbbbzzzz\=ovector=2
|
|
|
|
0: aaaabbbbzz
|
|
|
|
1: bbbb
|
|
|
|
|
2015-09-08 13:01:17 -04:00
|
|
|
/(*ANY)ab.cd/
|
2015-08-18 06:34:05 -04:00
|
|
|
ab-cd
|
|
|
|
0: ab-cd
|
|
|
|
ab=cd
|
|
|
|
0: ab=cd
|
2015-09-16 12:49:48 -04:00
|
|
|
\= Expect no match
|
2015-08-18 06:34:05 -04:00
|
|
|
ab\ncd
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
|
|
|
/ab.cd/s
|
|
|
|
ab-cd
|
|
|
|
0: ab-cd
|
|
|
|
ab=cd
|
|
|
|
0: ab=cd
|
|
|
|
ab\ncd
|
|
|
|
0: ab\x0acd
|
|
|
|
|
2016-01-31 14:14:15 -05:00
|
|
|
/a(b)c/posix_nosub
|
2015-08-18 06:34:05 -04:00
|
|
|
abc
|
|
|
|
Matched with REG_NOSUB
|
|
|
|
|
2016-01-31 14:14:15 -05:00
|
|
|
/a(?P<name>b)c/posix_nosub
|
2015-08-18 06:34:05 -04:00
|
|
|
abc
|
|
|
|
Matched with REG_NOSUB
|
|
|
|
|
2016-01-31 14:14:15 -05:00
|
|
|
/(a)\1/posix_nosub
|
|
|
|
zaay
|
|
|
|
Matched with REG_NOSUB
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
/a?|b?/
|
|
|
|
abc
|
|
|
|
0: a
|
2015-09-16 12:49:48 -04:00
|
|
|
\= Expect no match
|
2015-08-18 06:34:05 -04:00
|
|
|
ddd\=notempty
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
|
|
|
/\w+A/
|
|
|
|
CDAAAAB
|
|
|
|
0: CDAAAA
|
|
|
|
|
|
|
|
/\w+A/ungreedy
|
|
|
|
CDAAAAB
|
|
|
|
0: CDA
|
|
|
|
|
|
|
|
/\Biss\B/I,aftertext
|
|
|
|
** Ignored with POSIX interface: info
|
|
|
|
Mississippi
|
|
|
|
0: iss
|
|
|
|
0+ issippi
|
|
|
|
|
|
|
|
/abc/\
|
2016-10-02 12:01:01 -04:00
|
|
|
Failed: POSIX code 9: bad escape sequence at offset 4
|
2015-08-18 06:34:05 -04:00
|
|
|
|
|
|
|
"(?(?C)"
|
2016-02-13 10:30:29 -05:00
|
|
|
Failed: POSIX code 11: unbalanced () at offset 6
|
|
|
|
|
|
|
|
"(?(?C))"
|
2016-11-18 13:59:37 -05:00
|
|
|
Failed: POSIX code 3: pattern error at offset 6
|
2015-08-18 06:34:05 -04:00
|
|
|
|
2015-10-07 13:32:48 -04:00
|
|
|
/abcd/substitute_extended
|
|
|
|
** Ignored with POSIX interface: substitute_extended
|
|
|
|
|
2015-10-30 13:17:40 -04:00
|
|
|
/\[A]{1000000}**/expand,regerror_buffsize=31
|
|
|
|
Failed: POSIX code 4: ? * + invalid at offset 100000
|
|
|
|
** regerror() message truncated
|
|
|
|
|
|
|
|
/\[A]{1000000}**/expand,regerror_buffsize=32
|
|
|
|
Failed: POSIX code 4: ? * + invalid at offset 1000001
|
|
|
|
|
2016-10-23 12:18:15 -04:00
|
|
|
//posix_nosub
|
|
|
|
\=offset=70000
|
|
|
|
** Ignored with POSIX interface: offset
|
|
|
|
Matched with REG_NOSUB
|
|
|
|
|
2017-01-11 12:02:27 -05:00
|
|
|
/(?=(a\K))/
|
|
|
|
a
|
|
|
|
Start of matched string is beyond its end - displaying from end to start.
|
|
|
|
0: a
|
|
|
|
1: a
|
|
|
|
|
2017-06-03 12:42:58 -04:00
|
|
|
/^d(e)$/posix
|
|
|
|
acdef\=posix_startend=2:4
|
|
|
|
0: de
|
|
|
|
1: e
|
|
|
|
acde\=posix_startend=2
|
|
|
|
0: de
|
|
|
|
1: e
|
|
|
|
\= Expect no match
|
|
|
|
acdef
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
acdef\=posix_startend=2
|
|
|
|
No match: POSIX code 17: match failed
|
|
|
|
|
|
|
|
/^a\x{00}b$/posix
|
|
|
|
a\x{00}b\=posix_startend=0:3
|
|
|
|
0: a\x00b
|
|
|
|
|
2017-06-05 14:25:47 -04:00
|
|
|
/"A" 00 "B"/hex
|
|
|
|
A\x{00}B\=posix_startend=0:3
|
|
|
|
0: A\x00B
|
|
|
|
|
|
|
|
/ABC/use_length
|
|
|
|
ABC
|
|
|
|
0: ABC
|
|
|
|
|
2017-06-15 12:41:44 -04:00
|
|
|
/a\b(c/literal,posix
|
|
|
|
a\\b(c
|
|
|
|
0: a\b(c
|
|
|
|
|
|
|
|
/a\b(c/literal,posix,dotall
|
|
|
|
Failed: POSIX code 16: bad argument at offset 0
|
|
|
|
|
2018-02-19 09:49:42 -05:00
|
|
|
/((a)(b)?(c))/posix
|
|
|
|
123ace
|
|
|
|
0: ac
|
|
|
|
1: ac
|
|
|
|
2: a
|
|
|
|
3: <unset>
|
|
|
|
4: c
|
|
|
|
123ace\=posix_startend=2:6
|
|
|
|
0: ac
|
|
|
|
1: ac
|
|
|
|
2: a
|
|
|
|
3: <unset>
|
|
|
|
4: c
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# End of testdata/testinput18
|