testinput14 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. /-- This set of tests is run only with the 8-bit library. They do not require
  2. UTF-8 or Unicode property support. The file starts with all the tests of
  3. the POSIX interface, because that is supported only with the 8-bit library.
  4. --/
  5. < forbid 8W
  6. /abc/P
  7. abc
  8. *** Failers
  9. /^abc|def/P
  10. abcdef
  11. abcdef\B
  12. /.*((abc)$|(def))/P
  13. defabc
  14. \Zdefabc
  15. /the quick brown fox/P
  16. the quick brown fox
  17. *** Failers
  18. The Quick Brown Fox
  19. /the quick brown fox/Pi
  20. the quick brown fox
  21. The Quick Brown Fox
  22. /abc.def/P
  23. *** Failers
  24. abc\ndef
  25. /abc$/P
  26. abc
  27. abc\n
  28. /(abc)\2/P
  29. /(abc\1)/P
  30. abc
  31. /a*(b+)(z)(z)/P
  32. aaaabbbbzzzz
  33. aaaabbbbzzzz\O0
  34. aaaabbbbzzzz\O1
  35. aaaabbbbzzzz\O2
  36. aaaabbbbzzzz\O3
  37. aaaabbbbzzzz\O4
  38. aaaabbbbzzzz\O5
  39. /ab.cd/P
  40. ab-cd
  41. ab=cd
  42. ** Failers
  43. ab\ncd
  44. /ab.cd/Ps
  45. ab-cd
  46. ab=cd
  47. ab\ncd
  48. /a(b)c/PN
  49. abc
  50. /a(?P<name>b)c/PN
  51. abc
  52. /a?|b?/P
  53. abc
  54. ** Failers
  55. ddd\N
  56. /\w+A/P
  57. CDAAAAB
  58. /\w+A/PU
  59. CDAAAAB
  60. /\Biss\B/I+P
  61. Mississippi
  62. /abc/\P
  63. /-- End of POSIX tests --/
  64. /a\Cb/
  65. aXb
  66. a\nb
  67. ** Failers (too big char)
  68. A\x{123}B
  69. A\o{443}B
  70. /\x{100}/I
  71. /\o{400}/I
  72. / (?: [\040\t] | \(
  73. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  74. \) )* # optional leading comment
  75. (?: (?:
  76. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  77. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  78. |
  79. " (?: # opening quote...
  80. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  81. | # or
  82. \\ [^\x80-\xff] # Escaped something (something != CR)
  83. )* " # closing quote
  84. ) # initial word
  85. (?: (?: [\040\t] | \(
  86. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  87. \) )* \. (?: [\040\t] | \(
  88. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  89. \) )* (?:
  90. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  91. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  92. |
  93. " (?: # opening quote...
  94. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  95. | # or
  96. \\ [^\x80-\xff] # Escaped something (something != CR)
  97. )* " # closing quote
  98. ) )* # further okay, if led by a period
  99. (?: [\040\t] | \(
  100. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  101. \) )* @ (?: [\040\t] | \(
  102. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  103. \) )* (?:
  104. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  105. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  106. | \[ # [
  107. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  108. \] # ]
  109. ) # initial subdomain
  110. (?: #
  111. (?: [\040\t] | \(
  112. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  113. \) )* \. # if led by a period...
  114. (?: [\040\t] | \(
  115. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  116. \) )* (?:
  117. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  118. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  119. | \[ # [
  120. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  121. \] # ]
  122. ) # ...further okay
  123. )*
  124. # address
  125. | # or
  126. (?:
  127. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  128. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  129. |
  130. " (?: # opening quote...
  131. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  132. | # or
  133. \\ [^\x80-\xff] # Escaped something (something != CR)
  134. )* " # closing quote
  135. ) # one word, optionally followed by....
  136. (?:
  137. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  138. \(
  139. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  140. \) | # comments, or...
  141. " (?: # opening quote...
  142. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  143. | # or
  144. \\ [^\x80-\xff] # Escaped something (something != CR)
  145. )* " # closing quote
  146. # quoted strings
  147. )*
  148. < (?: [\040\t] | \(
  149. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  150. \) )* # leading <
  151. (?: @ (?: [\040\t] | \(
  152. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  153. \) )* (?:
  154. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  155. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  156. | \[ # [
  157. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  158. \] # ]
  159. ) # initial subdomain
  160. (?: #
  161. (?: [\040\t] | \(
  162. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  163. \) )* \. # if led by a period...
  164. (?: [\040\t] | \(
  165. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  166. \) )* (?:
  167. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  168. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  169. | \[ # [
  170. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  171. \] # ]
  172. ) # ...further okay
  173. )*
  174. (?: (?: [\040\t] | \(
  175. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  176. \) )* , (?: [\040\t] | \(
  177. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  178. \) )* @ (?: [\040\t] | \(
  179. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  180. \) )* (?:
  181. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  182. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  183. | \[ # [
  184. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  185. \] # ]
  186. ) # initial subdomain
  187. (?: #
  188. (?: [\040\t] | \(
  189. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  190. \) )* \. # if led by a period...
  191. (?: [\040\t] | \(
  192. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  193. \) )* (?:
  194. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  195. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  196. | \[ # [
  197. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  198. \] # ]
  199. ) # ...further okay
  200. )*
  201. )* # further okay, if led by comma
  202. : # closing colon
  203. (?: [\040\t] | \(
  204. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  205. \) )* )? # optional route
  206. (?:
  207. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  208. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  209. |
  210. " (?: # opening quote...
  211. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  212. | # or
  213. \\ [^\x80-\xff] # Escaped something (something != CR)
  214. )* " # closing quote
  215. ) # initial word
  216. (?: (?: [\040\t] | \(
  217. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  218. \) )* \. (?: [\040\t] | \(
  219. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  220. \) )* (?:
  221. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  222. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  223. |
  224. " (?: # opening quote...
  225. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  226. | # or
  227. \\ [^\x80-\xff] # Escaped something (something != CR)
  228. )* " # closing quote
  229. ) )* # further okay, if led by a period
  230. (?: [\040\t] | \(
  231. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  232. \) )* @ (?: [\040\t] | \(
  233. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  234. \) )* (?:
  235. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  236. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  237. | \[ # [
  238. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  239. \] # ]
  240. ) # initial subdomain
  241. (?: #
  242. (?: [\040\t] | \(
  243. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  244. \) )* \. # if led by a period...
  245. (?: [\040\t] | \(
  246. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  247. \) )* (?:
  248. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  249. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  250. | \[ # [
  251. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  252. \] # ]
  253. ) # ...further okay
  254. )*
  255. # address spec
  256. (?: [\040\t] | \(
  257. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  258. \) )* > # trailing >
  259. # name and address
  260. ) (?: [\040\t] | \(
  261. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  262. \) )* # optional trailing comment
  263. /xSI
  264. /-- Although this saved pattern was compiled with link-size=2, it does no harm
  265. to run this test with other link sizes because it is going to generated a
  266. "compiled in wrong mode" error as soon as it is loaded, so the link size does
  267. not matter. --/
  268. <!testsaved16
  269. <!testsaved32
  270. /\h/SI
  271. /\H/SI
  272. /\v/SI
  273. /\V/SI
  274. /\R/SI
  275. /[\h]/BZ
  276. >\x09<
  277. /[\h]+/BZ
  278. >\x09\x20\xa0<
  279. /[\v]/BZ
  280. /[\H]/BZ
  281. /[^\h]/BZ
  282. /[\V]/BZ
  283. /[\x0a\V]/BZ
  284. /\777/I
  285. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/K
  286. XX
  287. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/K
  288. XX
  289. /\u0100/<JS>
  290. /[\u0100-\u0200]/<JS>
  291. /[^\x00-a]{12,}[^b-\xff]*/BZ
  292. /[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/BZ
  293. /(?'ABC'[bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar]([bar](*THEN:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/
  294. /-- End of testinput14 --/