github的一些开源项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
2.8 KiB

  1. PCRE2 version 10.32-RC1 2018-02-19
  2. # This is a specialized test for checking, when PCRE2 is compiled with the
  3. # EBCDIC option but in an ASCII environment, that newline, white space, and \c
  4. # functionality is working. It catches cases where explicit values such as 0x0a
  5. # have been used instead of names like CHAR_LF. Needless to say, it is not a
  6. # genuine EBCDIC test! In patterns, alphabetic characters that follow a
  7. # backslash must be in EBCDIC code. In data, NL, NEL, LF, ESC, and DEL must be
  8. # in EBCDIC, but can of course be specified as escapes.
  9. # Test default newline and variations
  10. /^A/m
  11. ABC
  12. 0: A
  13. 12\x15ABC
  14. 0: A
  15. /^A/m,newline=any
  16. 12\x15ABC
  17. 0: A
  18. 12\x0dABC
  19. 0: A
  20. 12\x0d\x15ABC
  21. 0: A
  22. 12\x25ABC
  23. 0: A
  24. /^A/m,newline=anycrlf
  25. 12\x15ABC
  26. 0: A
  27. 12\x0dABC
  28. 0: A
  29. 12\x0d\x15ABC
  30. 0: A
  31. ** Fail
  32. No match
  33. 12\x25ABC
  34. No match
  35. # Test \h
  36. /^A\�/
  37. A B
  38. 0: A\x20
  39. A\x41B
  40. 0: AA
  41. # Test \H
  42. /^A\�/
  43. AB
  44. 0: AB
  45. A\x42B
  46. 0: AB
  47. ** Fail
  48. No match
  49. A B
  50. No match
  51. A\x41B
  52. No match
  53. # Test \R
  54. /^A\�/
  55. A\x15B
  56. 0: A\x15
  57. A\x0dB
  58. 0: A\x0d
  59. A\x25B
  60. 0: A\x25
  61. A\x0bB
  62. 0: A\x0b
  63. A\x0cB
  64. 0: A\x0c
  65. ** Fail
  66. No match
  67. A B
  68. No match
  69. # Test \v
  70. /^A\�/
  71. A\x15B
  72. 0: A\x15
  73. A\x0dB
  74. 0: A\x0d
  75. A\x25B
  76. 0: A\x25
  77. A\x0bB
  78. 0: A\x0b
  79. A\x0cB
  80. 0: A\x0c
  81. ** Fail
  82. No match
  83. A B
  84. No match
  85. # Test \V
  86. /^A\�/
  87. A B
  88. 0: A\x20
  89. ** Fail
  90. No match
  91. A\x15B
  92. No match
  93. A\x0dB
  94. No match
  95. A\x25B
  96. No match
  97. A\x0bB
  98. No match
  99. A\x0cB
  100. No match
  101. # For repeated items, use an atomic group so that the output is the same
  102. # for DFA matching (otherwise it may show multiple matches).
  103. # Test \h+
  104. /^A(?>\�+)/
  105. A B
  106. 0: A\x20
  107. # Test \H+
  108. /^A(?>\�+)/
  109. AB
  110. 0: AB
  111. ** Fail
  112. No match
  113. A B
  114. No match
  115. # Test \R+
  116. /^A(?>\�+)/
  117. A\x15B
  118. 0: A\x15
  119. A\x0dB
  120. 0: A\x0d
  121. A\x25B
  122. 0: A\x25
  123. A\x0bB
  124. 0: A\x0b
  125. A\x0cB
  126. 0: A\x0c
  127. ** Fail
  128. No match
  129. A B
  130. No match
  131. # Test \v+
  132. /^A(?>\�+)/
  133. A\x15B
  134. 0: A\x15
  135. A\x0dB
  136. 0: A\x0d
  137. A\x25B
  138. 0: A\x25
  139. A\x0bB
  140. 0: A\x0b
  141. A\x0cB
  142. 0: A\x0c
  143. ** Fail
  144. No match
  145. A B
  146. No match
  147. # Test \V+
  148. /^A(?>\�+)/
  149. A B
  150. 0: A\x20B
  151. ** Fail
  152. No match
  153. A\x15B
  154. No match
  155. A\x0dB
  156. No match
  157. A\x25B
  158. No match
  159. A\x0bB
  160. No match
  161. A\x0cB
  162. No match
  163. # Test \c functionality
  164. /\�@\�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/
  165. \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
  166. 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
  167. /\�[\�\\�]\�^\�_/
  168. \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f
  169. 0: \x1b\x1c\x1d\x1e\x1f
  170. /\�?/
  171. A\xffB
  172. 0: \xff
  173. /\�&/
  174. Failed: error 168 at offset 3: \c\x20must\x20be\x20followed\x20by\x20a\x20letter\x20or\x20one\x20of\x20[\]^_\x3f
  175. # End