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.

374 lines
16 KiB

  1. # This set of tests is run only with the 8-bit library. They must not require
  2. # UTF-8 or Unicode property support. */
  3. #forbid_utf
  4. #newline_default lf any anycrlf
  5. /ab/
  6. \= Expect error message (too big char) and no match
  7. A\x{123}B
  8. ** Character \x{123} is greater than 255 and UTF-8 mode is not enabled.
  9. ** Truncation will probably give the wrong result.
  10. No match
  11. A\o{443}B
  12. ** Character \x{123} is greater than 255 and UTF-8 mode is not enabled.
  13. ** Truncation will probably give the wrong result.
  14. No match
  15. /\x{100}/I
  16. Failed: error 134 at offset 6: character code point value in \x{} or \o{} is too large
  17. /\o{400}/I
  18. Failed: error 134 at offset 6: character code point value in \x{} or \o{} is too large
  19. / (?: [\040\t] | \(
  20. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  21. \) )* # optional leading comment
  22. (?: (?:
  23. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  24. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  25. |
  26. " (?: # opening quote...
  27. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  28. | # or
  29. \\ [^\x80-\xff] # Escaped something (something != CR)
  30. )* " # closing quote
  31. ) # initial word
  32. (?: (?: [\040\t] | \(
  33. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  34. \) )* \. (?: [\040\t] | \(
  35. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  36. \) )* (?:
  37. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  38. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  39. |
  40. " (?: # opening quote...
  41. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  42. | # or
  43. \\ [^\x80-\xff] # Escaped something (something != CR)
  44. )* " # closing quote
  45. ) )* # further okay, if led by a period
  46. (?: [\040\t] | \(
  47. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  48. \) )* @ (?: [\040\t] | \(
  49. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  50. \) )* (?:
  51. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  52. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  53. | \[ # [
  54. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  55. \] # ]
  56. ) # initial subdomain
  57. (?: #
  58. (?: [\040\t] | \(
  59. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  60. \) )* \. # if led by a period...
  61. (?: [\040\t] | \(
  62. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  63. \) )* (?:
  64. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  65. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  66. | \[ # [
  67. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  68. \] # ]
  69. ) # ...further okay
  70. )*
  71. # address
  72. | # or
  73. (?:
  74. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  75. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  76. |
  77. " (?: # opening quote...
  78. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  79. | # or
  80. \\ [^\x80-\xff] # Escaped something (something != CR)
  81. )* " # closing quote
  82. ) # one word, optionally followed by....
  83. (?:
  84. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  85. \(
  86. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  87. \) | # comments, or...
  88. " (?: # opening quote...
  89. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  90. | # or
  91. \\ [^\x80-\xff] # Escaped something (something != CR)
  92. )* " # closing quote
  93. # quoted strings
  94. )*
  95. < (?: [\040\t] | \(
  96. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  97. \) )* # leading <
  98. (?: @ (?: [\040\t] | \(
  99. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  100. \) )* (?:
  101. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  102. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  103. | \[ # [
  104. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  105. \] # ]
  106. ) # initial subdomain
  107. (?: #
  108. (?: [\040\t] | \(
  109. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  110. \) )* \. # if led by a period...
  111. (?: [\040\t] | \(
  112. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  113. \) )* (?:
  114. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  115. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  116. | \[ # [
  117. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  118. \] # ]
  119. ) # ...further okay
  120. )*
  121. (?: (?: [\040\t] | \(
  122. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  123. \) )* , (?: [\040\t] | \(
  124. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  125. \) )* @ (?: [\040\t] | \(
  126. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  127. \) )* (?:
  128. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  129. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  130. | \[ # [
  131. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  132. \] # ]
  133. ) # initial subdomain
  134. (?: #
  135. (?: [\040\t] | \(
  136. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  137. \) )* \. # if led by a period...
  138. (?: [\040\t] | \(
  139. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  140. \) )* (?:
  141. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  142. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  143. | \[ # [
  144. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  145. \] # ]
  146. ) # ...further okay
  147. )*
  148. )* # further okay, if led by comma
  149. : # closing colon
  150. (?: [\040\t] | \(
  151. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  152. \) )* )? # optional route
  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. " (?: # opening quote...
  158. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  159. | # or
  160. \\ [^\x80-\xff] # Escaped something (something != CR)
  161. )* " # closing quote
  162. ) # initial word
  163. (?: (?: [\040\t] | \(
  164. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  165. \) )* \. (?: [\040\t] | \(
  166. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  167. \) )* (?:
  168. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  169. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  170. |
  171. " (?: # opening quote...
  172. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  173. | # or
  174. \\ [^\x80-\xff] # Escaped something (something != CR)
  175. )* " # closing quote
  176. ) )* # further okay, if led by a period
  177. (?: [\040\t] | \(
  178. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  179. \) )* @ (?: [\040\t] | \(
  180. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  181. \) )* (?:
  182. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  183. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  184. | \[ # [
  185. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  186. \] # ]
  187. ) # initial subdomain
  188. (?: #
  189. (?: [\040\t] | \(
  190. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  191. \) )* \. # if led by a period...
  192. (?: [\040\t] | \(
  193. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  194. \) )* (?:
  195. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  196. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  197. | \[ # [
  198. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  199. \] # ]
  200. ) # ...further okay
  201. )*
  202. # address spec
  203. (?: [\040\t] | \(
  204. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  205. \) )* > # trailing >
  206. # name and address
  207. ) (?: [\040\t] | \(
  208. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  209. \) )* # optional trailing comment
  210. /Ix
  211. Capture group count = 0
  212. Contains explicit CR or LF match
  213. Options: extended
  214. Starting code units: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
  215. 9 = ? 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 ^ _ ` a b c d e
  216. f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
  217. Subject length lower bound = 3
  218. /\h/I
  219. Capture group count = 0
  220. Starting code units: \x09 \x20 \xa0
  221. Subject length lower bound = 1
  222. /\H/I
  223. Capture group count = 0
  224. Subject length lower bound = 1
  225. /\v/I
  226. Capture group count = 0
  227. Starting code units: \x0a \x0b \x0c \x0d \x85
  228. Subject length lower bound = 1
  229. /\V/I
  230. Capture group count = 0
  231. Subject length lower bound = 1
  232. /\R/I
  233. Capture group count = 0
  234. Starting code units: \x0a \x0b \x0c \x0d \x85
  235. Subject length lower bound = 1
  236. /[\h]/B
  237. ------------------------------------------------------------------
  238. Bra
  239. [\x09 \xa0]
  240. Ket
  241. End
  242. ------------------------------------------------------------------
  243. >\x09<
  244. 0: \x09
  245. /[\h]+/B
  246. ------------------------------------------------------------------
  247. Bra
  248. [\x09 \xa0]++
  249. Ket
  250. End
  251. ------------------------------------------------------------------
  252. >\x09\x20\xa0<
  253. 0: \x09 \xa0
  254. /[\v]/B
  255. ------------------------------------------------------------------
  256. Bra
  257. [\x0a-\x0d\x85]
  258. Ket
  259. End
  260. ------------------------------------------------------------------
  261. /[\H]/B
  262. ------------------------------------------------------------------
  263. Bra
  264. [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff]
  265. Ket
  266. End
  267. ------------------------------------------------------------------
  268. /[^\h]/B
  269. ------------------------------------------------------------------
  270. Bra
  271. [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff] (neg)
  272. Ket
  273. End
  274. ------------------------------------------------------------------
  275. /[\V]/B
  276. ------------------------------------------------------------------
  277. Bra
  278. [\x00-\x09\x0e-\x84\x86-\xff]
  279. Ket
  280. End
  281. ------------------------------------------------------------------
  282. /[\x0a\V]/B
  283. ------------------------------------------------------------------
  284. Bra
  285. [\x00-\x0a\x0e-\x84\x86-\xff]
  286. Ket
  287. End
  288. ------------------------------------------------------------------
  289. /\777/I
  290. Failed: error 151 at offset 4: octal value is greater than \377 in 8-bit non-UTF-8 mode
  291. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/mark
  292. Failed: error 176 at offset 259: name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
  293. XX
  294. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF)XX/mark,alt_verbnames
  295. Failed: error 176 at offset 259: name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
  296. XX
  297. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark
  298. XX
  299. 0: XX
  300. MK: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
  301. /(*:0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE)XX/mark,alt_verbnames
  302. XX
  303. 0: XX
  304. MK: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
  305. /\u0100/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  306. Failed: error 177 at offset 6: character code point value in \u.... sequence is too large
  307. /[\u0100-\u0200]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  308. Failed: error 177 at offset 7: character code point value in \u.... sequence is too large
  309. /[^\x00-a]{12,}[^b-\xff]*/B
  310. ------------------------------------------------------------------
  311. Bra
  312. [b-\xff] (neg){12,}+
  313. [\x00-a] (neg)*+
  314. Ket
  315. End
  316. ------------------------------------------------------------------
  317. /[^\s]*\s* [^\W]+\W+ [^\d]*?\d0 [^\d\w]{4,6}?\w*A/B
  318. ------------------------------------------------------------------
  319. Bra
  320. [\x00-\x08\x0e-\x1f!-\xff] (neg)*+
  321. \s*
  322. [0-9A-Z_a-z]++
  323. \W+
  324. [\x00-/:-\xff] (neg)*+
  325. \d
  326. 0
  327. [\x00-/:-@[-^`{-\xff] (neg){4,6}+
  328. \w*
  329. A
  330. Ket
  331. End
  332. ------------------------------------------------------------------
  333. /(*MARK:a\x{100}b)z/alt_verbnames
  334. Failed: error 134 at offset 14: character code point value in \x{} or \o{} is too large
  335. /(*:*++++++++++++''''''''''''''''''''+''+++'+++x+++++++++++++++++++++++++++++++++++(++++++++++++++++++++:++++++%++:''''''''''''''''''''''''+++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++k+++++++''''+++'+++++++++++++++++++++++''''++++++++++++':ƿ)/
  336. Failed: error 176 at offset 259: name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
  337. /(?i:A{1,}\6666666666)/
  338. Failed: error 151 at offset 13: octal value is greater than \377 in 8-bit non-UTF-8 mode
  339. A\x{1b6}6666666
  340. # End of testinput9