200 lines
2.7 KiB
Plaintext
200 lines
2.7 KiB
Plaintext
# This is a specialized test for checking, when PCRE2 is compiled with the
|
||
# EBCDIC option but in an ASCII environment, that newline, white space, and \c
|
||
# functionality is working. It catches cases where explicit values such as 0x0a
|
||
# have been used instead of names like CHAR_LF. Needless to say, it is not a
|
||
# genuine EBCDIC test! In patterns, alphabetic characters that follow a
|
||
# backslash must be in EBCDIC code. In data, NL, NEL, LF, ESC, and DEL must be
|
||
# in EBCDIC, but can of course be specified as escapes.
|
||
|
||
# Test default newline and variations
|
||
|
||
/^A/m
|
||
ABC
|
||
0: A
|
||
12\x15ABC
|
||
0: A
|
||
|
||
/^A/m,newline=any
|
||
12\x15ABC
|
||
0: A
|
||
12\x0dABC
|
||
0: A
|
||
12\x0d\x15ABC
|
||
0: A
|
||
12\x25ABC
|
||
0: A
|
||
|
||
/^A/m,newline=anycrlf
|
||
12\x15ABC
|
||
0: A
|
||
12\x0dABC
|
||
0: A
|
||
12\x0d\x15ABC
|
||
0: A
|
||
** Fail
|
||
No match
|
||
12\x25ABC
|
||
No match
|
||
|
||
# Test \h
|
||
|
||
/^A\ˆ/
|
||
A B
|
||
0: A\x20
|
||
|
||
# Test \H
|
||
|
||
/^A\È/
|
||
AB
|
||
0: AB
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \R
|
||
|
||
/^A\Ù/
|
||
A\x15B
|
||
0: A\x15
|
||
A\x0dB
|
||
0: A\x0d
|
||
A\x25B
|
||
0: A\x25
|
||
A\x0bB
|
||
0: A\x0b
|
||
A\x0cB
|
||
0: A\x0c
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \v
|
||
|
||
/^A\¥/
|
||
A\x15B
|
||
0: A\x15
|
||
A\x0dB
|
||
0: A\x0d
|
||
A\x25B
|
||
0: A\x25
|
||
A\x0bB
|
||
0: A\x0b
|
||
A\x0cB
|
||
0: A\x0c
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \V
|
||
|
||
/^A\å/
|
||
A B
|
||
0: A\x20
|
||
** Fail
|
||
No match
|
||
A\x15B
|
||
No match
|
||
A\x0dB
|
||
No match
|
||
A\x25B
|
||
No match
|
||
A\x0bB
|
||
No match
|
||
A\x0cB
|
||
No match
|
||
|
||
# For repeated items, use an atomic group so that the output is the same
|
||
# for DFA matching (otherwise it may show multiple matches).
|
||
|
||
# Test \h+
|
||
|
||
/^A(?>\ˆ+)/
|
||
A B
|
||
0: A\x20
|
||
|
||
# Test \H+
|
||
|
||
/^A(?>\È+)/
|
||
AB
|
||
0: AB
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \R+
|
||
|
||
/^A(?>\Ù+)/
|
||
A\x15B
|
||
0: A\x15
|
||
A\x0dB
|
||
0: A\x0d
|
||
A\x25B
|
||
0: A\x25
|
||
A\x0bB
|
||
0: A\x0b
|
||
A\x0cB
|
||
0: A\x0c
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \v+
|
||
|
||
/^A(?>\¥+)/
|
||
A\x15B
|
||
0: A\x15
|
||
A\x0dB
|
||
0: A\x0d
|
||
A\x25B
|
||
0: A\x25
|
||
A\x0bB
|
||
0: A\x0b
|
||
A\x0cB
|
||
0: A\x0c
|
||
** Fail
|
||
No match
|
||
A B
|
||
No match
|
||
|
||
# Test \V+
|
||
|
||
/^A(?>\å+)/
|
||
A B
|
||
0: A\x20B
|
||
** Fail
|
||
No match
|
||
A\x15B
|
||
No match
|
||
A\x0dB
|
||
No match
|
||
A\x25B
|
||
No match
|
||
A\x0bB
|
||
No match
|
||
A\x0cB
|
||
No match
|
||
|
||
# Test \c functionality
|
||
|
||
/\ƒ@\ƒA\ƒb\ƒC\ƒd\ƒE\ƒf\ƒG\ƒh\ƒI\ƒJ\ƒK\ƒl\ƒm\ƒN\ƒO\ƒp\ƒq\ƒr\ƒS\ƒT\ƒu\ƒV\ƒW\ƒX\ƒy\ƒZ/
|
||
\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
|
||
0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a
|
||
|
||
/\ƒ[\ƒ\\ƒ]\ƒ^\ƒ_/
|
||
\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
|
||
0: \x1b\x1c\x1d\x1e\x1f
|
||
|
||
/\ƒ?/
|
||
A\xffB
|
||
0: \xff
|
||
|
||
/\ƒ&/
|
||
Failed: error 168 at offset 2: \c\x20must\x20be\x20followed\x20by\x20a\x20letter\x20or\x20one\x20of\x20[\]^_\x3f
|
||
|
||
# End
|