2014-10-26 14:00:19 -04:00
|
|
|
|
# This is a specialized test for checking, when PCRE2 is compiled with the
|
2015-06-13 12:10:14 -04:00
|
|
|
|
# EBCDIC option but in an ASCII environment, that newline, white space, and \c
|
2014-10-26 14:00:19 -04:00
|
|
|
|
# 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
|
|
|
|
|
12\x15ABC
|
|
|
|
|
|
|
|
|
|
/^A/m,newline=any
|
|
|
|
|
12\x15ABC
|
|
|
|
|
12\x0dABC
|
|
|
|
|
12\x0d\x15ABC
|
|
|
|
|
12\x25ABC
|
|
|
|
|
|
|
|
|
|
/^A/m,newline=anycrlf
|
|
|
|
|
12\x15ABC
|
|
|
|
|
12\x0dABC
|
|
|
|
|
12\x0d\x15ABC
|
|
|
|
|
** Fail
|
|
|
|
|
12\x25ABC
|
|
|
|
|
|
|
|
|
|
# Test \h
|
|
|
|
|
|
|
|
|
|
/^A\<5C>/
|
|
|
|
|
A B
|
2015-06-19 12:41:22 -04:00
|
|
|
|
A\x41B
|
2014-10-26 14:00:19 -04:00
|
|
|
|
|
|
|
|
|
# Test \H
|
|
|
|
|
|
|
|
|
|
/^A\<5C>/
|
|
|
|
|
AB
|
2015-06-19 12:41:22 -04:00
|
|
|
|
A\x42B
|
2014-10-26 14:00:19 -04:00
|
|
|
|
** Fail
|
|
|
|
|
A B
|
2015-06-19 12:41:22 -04:00
|
|
|
|
A\x41B
|
2014-10-26 14:00:19 -04:00
|
|
|
|
|
|
|
|
|
# Test \R
|
|
|
|
|
|
|
|
|
|
/^A\<5C>/
|
|
|
|
|
A\x15B
|
|
|
|
|
A\x0dB
|
|
|
|
|
A\x25B
|
|
|
|
|
A\x0bB
|
|
|
|
|
A\x0cB
|
|
|
|
|
** Fail
|
|
|
|
|
A B
|
|
|
|
|
|
|
|
|
|
# Test \v
|
|
|
|
|
|
|
|
|
|
/^A\<5C>/
|
|
|
|
|
A\x15B
|
|
|
|
|
A\x0dB
|
|
|
|
|
A\x25B
|
|
|
|
|
A\x0bB
|
|
|
|
|
A\x0cB
|
|
|
|
|
** Fail
|
|
|
|
|
A B
|
|
|
|
|
|
|
|
|
|
# Test \V
|
|
|
|
|
|
|
|
|
|
/^A\<5C>/
|
|
|
|
|
A B
|
|
|
|
|
** Fail
|
|
|
|
|
A\x15B
|
|
|
|
|
A\x0dB
|
|
|
|
|
A\x25B
|
|
|
|
|
A\x0bB
|
|
|
|
|
A\x0cB
|
|
|
|
|
|
|
|
|
|
# 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(?>\<5C>+)/
|
|
|
|
|
A B
|
|
|
|
|
|
|
|
|
|
# Test \H+
|
|
|
|
|
|
|
|
|
|
/^A(?>\<5C>+)/
|
|
|
|
|
AB
|
|
|
|
|
** Fail
|
|
|
|
|
A B
|
|
|
|
|
|
|
|
|
|
# Test \R+
|
|
|
|
|
|
|
|
|
|
/^A(?>\<5C>+)/
|
|
|
|
|
A\x15B
|
|
|
|
|
A\x0dB
|
|
|
|
|
A\x25B
|
|
|
|
|
A\x0bB
|
|
|
|
|
A\x0cB
|
|
|
|
|
** Fail
|
|
|
|
|
A B
|
|
|
|
|
|
|
|
|
|
# Test \v+
|
|
|
|
|
|
|
|
|
|
/^A(?>\<5C>+)/
|
|
|
|
|
A\x15B
|
|
|
|
|
A\x0dB
|
|
|
|
|
A\x25B
|
|
|
|
|
A\x0bB
|
|
|
|
|
A\x0cB
|
|
|
|
|
** Fail
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