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.

2534 lines
41 KiB

  1. # This set of tests checks UTF and Unicode property support with the DFA
  2. # matching functionality of pcre2_dfa_match(). A default subject modifier is
  3. # used to force DFA matching for all tests.
  4. #subject dfa
  5. #newline_default LF any anyCRLF
  6. /\x{100}ab/utf
  7. \x{100}ab
  8. /a\x{100}*b/utf
  9. ab
  10. a\x{100}b
  11. a\x{100}\x{100}b
  12. /a\x{100}+b/utf
  13. a\x{100}b
  14. a\x{100}\x{100}b
  15. \= Expect no match
  16. ab
  17. /\bX/utf
  18. Xoanon
  19. +Xoanon
  20. \x{300}Xoanon
  21. \= Expect no match
  22. YXoanon
  23. /\BX/utf
  24. YXoanon
  25. \= Expect no match
  26. Xoanon
  27. +Xoanon
  28. \x{300}Xoanon
  29. /X\b/utf
  30. X+oanon
  31. ZX\x{300}oanon
  32. FAX
  33. \= Expect no match
  34. Xoanon
  35. /X\B/utf
  36. Xoanon
  37. \= Expect no match
  38. X+oanon
  39. ZX\x{300}oanon
  40. FAX
  41. /[^a]/utf
  42. abcd
  43. a\x{100}
  44. /^[abc\x{123}\x{400}-\x{402}]{2,3}\d/utf
  45. ab99
  46. \x{123}\x{123}45
  47. \x{400}\x{401}\x{402}6
  48. \= Expect no match
  49. d99
  50. \x{123}\x{122}4
  51. \x{400}\x{403}6
  52. \x{400}\x{401}\x{402}\x{402}6
  53. /a.b/utf
  54. acb
  55. a\x7fb
  56. a\x{100}b
  57. \= Expect no match
  58. a\nb
  59. /a(.{3})b/utf
  60. a\x{4000}xyb
  61. a\x{4000}\x7fyb
  62. a\x{4000}\x{100}yb
  63. \= Expect no match
  64. a\x{4000}b
  65. ac\ncb
  66. /a(.*?)(.)/
  67. a\xc0\x88b
  68. /a(.*?)(.)/utf
  69. a\x{100}b
  70. /a(.*)(.)/
  71. a\xc0\x88b
  72. /a(.*)(.)/utf
  73. a\x{100}b
  74. /a(.)(.)/
  75. a\xc0\x92bcd
  76. /a(.)(.)/utf
  77. a\x{240}bcd
  78. /a(.?)(.)/
  79. a\xc0\x92bcd
  80. /a(.?)(.)/utf
  81. a\x{240}bcd
  82. /a(.??)(.)/
  83. a\xc0\x92bcd
  84. /a(.??)(.)/utf
  85. a\x{240}bcd
  86. /a(.{3})b/utf
  87. a\x{1234}xyb
  88. a\x{1234}\x{4321}yb
  89. a\x{1234}\x{4321}\x{3412}b
  90. \= Expect no match
  91. a\x{1234}b
  92. ac\ncb
  93. /a(.{3,})b/utf
  94. a\x{1234}xyb
  95. a\x{1234}\x{4321}yb
  96. a\x{1234}\x{4321}\x{3412}b
  97. axxxxbcdefghijb
  98. a\x{1234}\x{4321}\x{3412}\x{3421}b
  99. \= Expect no match
  100. a\x{1234}b
  101. /a(.{3,}?)b/utf
  102. a\x{1234}xyb
  103. a\x{1234}\x{4321}yb
  104. a\x{1234}\x{4321}\x{3412}b
  105. axxxxbcdefghijb
  106. a\x{1234}\x{4321}\x{3412}\x{3421}b
  107. \= Expect no match
  108. a\x{1234}b
  109. /a(.{3,5})b/utf
  110. a\x{1234}xyb
  111. a\x{1234}\x{4321}yb
  112. a\x{1234}\x{4321}\x{3412}b
  113. axxxxbcdefghijb
  114. a\x{1234}\x{4321}\x{3412}\x{3421}b
  115. axbxxbcdefghijb
  116. axxxxxbcdefghijb
  117. \= Expect no match
  118. a\x{1234}b
  119. axxxxxxbcdefghijb
  120. /a(.{3,5}?)b/utf
  121. a\x{1234}xyb
  122. a\x{1234}\x{4321}yb
  123. a\x{1234}\x{4321}\x{3412}b
  124. axxxxbcdefghijb
  125. a\x{1234}\x{4321}\x{3412}\x{3421}b
  126. axbxxbcdefghijb
  127. axxxxxbcdefghijb
  128. \= Expect no match
  129. a\x{1234}b
  130. axxxxxxbcdefghijb
  131. /^[a\x{c0}]/utf
  132. \= Expect no match
  133. \x{100}
  134. /(?<=aXb)cd/utf
  135. aXbcd
  136. /(?<=a\x{100}b)cd/utf
  137. a\x{100}bcd
  138. /(?<=a\x{100000}b)cd/utf
  139. a\x{100000}bcd
  140. /(?:\x{100}){3}b/utf
  141. \x{100}\x{100}\x{100}b
  142. \= Expect no match
  143. \x{100}\x{100}b
  144. /\x{ab}/utf
  145. \x{ab}
  146. \xc2\xab
  147. \= Expect no match
  148. \x00{ab}
  149. /(?<=(.))X/utf
  150. WXYZ
  151. \x{256}XYZ
  152. \= Expect no match
  153. XYZ
  154. /[^a]+/g,utf
  155. bcd
  156. \x{100}aY\x{256}Z
  157. /^[^a]{2}/utf
  158. \x{100}bc
  159. /^[^a]{2,}/utf
  160. \x{100}bcAa
  161. /^[^a]{2,}?/utf
  162. \x{100}bca
  163. /[^a]+/gi,utf
  164. bcd
  165. \x{100}aY\x{256}Z
  166. /^[^a]{2}/i,utf
  167. \x{100}bc
  168. /^[^a]{2,}/i,utf
  169. \x{100}bcAa
  170. /^[^a]{2,}?/i,utf
  171. \x{100}bca
  172. /\x{100}{0,0}/utf
  173. abcd
  174. /\x{100}?/utf
  175. abcd
  176. \x{100}\x{100}
  177. /\x{100}{0,3}/utf
  178. \x{100}\x{100}
  179. \x{100}\x{100}\x{100}\x{100}
  180. /\x{100}*/utf
  181. abce
  182. \x{100}\x{100}\x{100}\x{100}
  183. /\x{100}{1,1}/utf
  184. abcd\x{100}\x{100}\x{100}\x{100}
  185. /\x{100}{1,3}/utf
  186. abcd\x{100}\x{100}\x{100}\x{100}
  187. /\x{100}+/utf
  188. abcd\x{100}\x{100}\x{100}\x{100}
  189. /\x{100}{3}/utf
  190. abcd\x{100}\x{100}\x{100}XX
  191. /\x{100}{3,5}/utf
  192. abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
  193. /\x{100}{3,}/utf,no_auto_possess
  194. abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
  195. /(?<=a\x{100}{2}b)X/utf
  196. Xyyya\x{100}\x{100}bXzzz
  197. /\D*/utf,no_auto_possess
  198. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  199. /\D*/utf,no_auto_possess
  200. \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
  201. /\D/utf
  202. 1X2
  203. 1\x{100}2
  204. />\S/utf
  205. > >X Y
  206. > >\x{100} Y
  207. /\d/utf
  208. \x{100}3
  209. /\s/utf
  210. \x{100} X
  211. /\D+/utf
  212. 12abcd34
  213. \= Expect no match
  214. 1234
  215. /\D{2,3}/utf
  216. 12abcd34
  217. 12ab34
  218. \= Expect no match
  219. 1234
  220. 12a34
  221. /\D{2,3}?/utf
  222. 12abcd34
  223. 12ab34
  224. \= Expect no match
  225. 1234
  226. 12a34
  227. /\d+/utf
  228. 12abcd34
  229. /\d{2,3}/utf
  230. 12abcd34
  231. 1234abcd
  232. \= Expect no match
  233. 1.4
  234. /\d{2,3}?/utf
  235. 12abcd34
  236. 1234abcd
  237. \= Expect no match
  238. 1.4
  239. /\S+/utf
  240. 12abcd34
  241. \= Expect no match
  242. \ \
  243. /\S{2,3}/utf
  244. 12abcd34
  245. 1234abcd
  246. \= Expect no match
  247. \ \
  248. /\S{2,3}?/utf
  249. 12abcd34
  250. 1234abcd
  251. \= Expect no match
  252. \ \
  253. />\s+</utf
  254. 12> <34
  255. />\s{2,3}</utf
  256. ab> <cd
  257. ab> <ce
  258. \= Expect no match
  259. ab> <cd
  260. />\s{2,3}?</utf
  261. ab> <cd
  262. ab> <ce
  263. \= Expect no match
  264. ab> <cd
  265. /\w+/utf
  266. 12 34
  267. \= Expect no match
  268. +++=*!
  269. /\w{2,3}/utf
  270. ab cd
  271. abcd ce
  272. \= Expect no match
  273. a.b.c
  274. /\w{2,3}?/utf
  275. ab cd
  276. abcd ce
  277. \= Expect no match
  278. a.b.c
  279. /\W+/utf
  280. 12====34
  281. \= Expect no match
  282. abcd
  283. /\W{2,3}/utf
  284. ab====cd
  285. ab==cd
  286. \= Expect no match
  287. a.b.c
  288. /\W{2,3}?/utf
  289. ab====cd
  290. ab==cd
  291. \= Expect no match
  292. a.b.c
  293. /[\x{100}]/utf
  294. \x{100}
  295. Z\x{100}
  296. \x{100}Z
  297. /[Z\x{100}]/utf
  298. Z\x{100}
  299. \x{100}
  300. \x{100}Z
  301. /[\x{100}\x{200}]/utf
  302. ab\x{100}cd
  303. ab\x{200}cd
  304. /[\x{100}-\x{200}]/utf
  305. ab\x{100}cd
  306. ab\x{200}cd
  307. ab\x{111}cd
  308. /[z-\x{200}]/utf
  309. ab\x{100}cd
  310. ab\x{200}cd
  311. ab\x{111}cd
  312. abzcd
  313. ab|cd
  314. /[Q\x{100}\x{200}]/utf
  315. ab\x{100}cd
  316. ab\x{200}cd
  317. Q?
  318. /[Q\x{100}-\x{200}]/utf
  319. ab\x{100}cd
  320. ab\x{200}cd
  321. ab\x{111}cd
  322. Q?
  323. /[Qz-\x{200}]/utf
  324. ab\x{100}cd
  325. ab\x{200}cd
  326. ab\x{111}cd
  327. abzcd
  328. ab|cd
  329. Q?
  330. /[\x{100}\x{200}]{1,3}/utf
  331. ab\x{100}cd
  332. ab\x{200}cd
  333. ab\x{200}\x{100}\x{200}\x{100}cd
  334. /[\x{100}\x{200}]{1,3}?/utf
  335. ab\x{100}cd
  336. ab\x{200}cd
  337. ab\x{200}\x{100}\x{200}\x{100}cd
  338. /[Q\x{100}\x{200}]{1,3}/utf
  339. ab\x{100}cd
  340. ab\x{200}cd
  341. ab\x{200}\x{100}\x{200}\x{100}cd
  342. /[Q\x{100}\x{200}]{1,3}?/utf
  343. ab\x{100}cd
  344. ab\x{200}cd
  345. ab\x{200}\x{100}\x{200}\x{100}cd
  346. /(?<=[\x{100}\x{200}])X/utf
  347. abc\x{200}X
  348. abc\x{100}X
  349. \= Expect no match
  350. X
  351. /(?<=[Q\x{100}\x{200}])X/utf
  352. abc\x{200}X
  353. abc\x{100}X
  354. abQX
  355. \= Expect no match
  356. X
  357. /(?<=[\x{100}\x{200}]{3})X/utf
  358. abc\x{100}\x{200}\x{100}X
  359. \= Expect no match
  360. abc\x{200}X
  361. X
  362. /[^\x{100}\x{200}]X/utf
  363. AX
  364. \x{150}X
  365. \x{500}X
  366. \= Expect no match
  367. \x{100}X
  368. \x{200}X
  369. /[^Q\x{100}\x{200}]X/utf
  370. AX
  371. \x{150}X
  372. \x{500}X
  373. \= Expect no match
  374. \x{100}X
  375. \x{200}X
  376. QX
  377. /[^\x{100}-\x{200}]X/utf
  378. AX
  379. \x{500}X
  380. \= Expect no match
  381. \x{100}X
  382. \x{150}X
  383. \x{200}X
  384. /[z-\x{100}]/i,utf
  385. z
  386. Z
  387. \x{100}
  388. \= Expect no match
  389. \x{102}
  390. y
  391. /[\xFF]/
  392. >\xff<
  393. /[\xff]/utf
  394. >\x{ff}<
  395. /[^\xFF]/
  396. XYZ
  397. /[^\xff]/utf
  398. XYZ
  399. \x{123}
  400. /^[ac]*b/utf
  401. \= Expect no match
  402. xb
  403. /^[ac\x{100}]*b/utf
  404. \= Expect no match
  405. xb
  406. /^[^x]*b/i,utf
  407. \= Expect no match
  408. xb
  409. /^[^x]*b/utf
  410. \= Expect no match
  411. xb
  412. /^\d*b/utf
  413. \= Expect no match
  414. xb
  415. /(|a)/g,utf
  416. catac
  417. a\x{256}a
  418. /^\x{85}$/i,utf
  419. \x{85}
  420. /^abc./gmx,newline=any,utf
  421. abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK
  422. /abc.$/gmx,newline=any,utf
  423. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9
  424. /^a\Rb/bsr=unicode,utf
  425. a\nb
  426. a\rb
  427. a\r\nb
  428. a\x0bb
  429. a\x0cb
  430. a\x{85}b
  431. a\x{2028}b
  432. a\x{2029}b
  433. \= Expect no match
  434. a\n\rb
  435. /^a\R*b/bsr=unicode,utf
  436. ab
  437. a\nb
  438. a\rb
  439. a\r\nb
  440. a\x0bb
  441. a\x0c\x{2028}\x{2029}b
  442. a\x{85}b
  443. a\n\rb
  444. a\n\r\x{85}\x0cb
  445. /^a\R+b/bsr=unicode,utf
  446. a\nb
  447. a\rb
  448. a\r\nb
  449. a\x0bb
  450. a\x0c\x{2028}\x{2029}b
  451. a\x{85}b
  452. a\n\rb
  453. a\n\r\x{85}\x0cb
  454. \= Expect no match
  455. ab
  456. /^a\R{1,3}b/bsr=unicode,utf
  457. a\nb
  458. a\n\rb
  459. a\n\r\x{85}b
  460. a\r\n\r\nb
  461. a\r\n\r\n\r\nb
  462. a\n\r\n\rb
  463. a\n\n\r\nb
  464. \= Expect no match
  465. a\n\n\n\rb
  466. a\r
  467. /\h+\V?\v{3,4}/utf,no_auto_possess
  468. \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
  469. /\V?\v{3,4}/utf,no_auto_possess
  470. \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
  471. /\h+\V?\v{3,4}/utf,no_auto_possess
  472. >\x09\x20\x{a0}X\x0a\x0a\x0a<
  473. /\V?\v{3,4}/utf,no_auto_possess
  474. >\x09\x20\x{a0}X\x0a\x0a\x0a<
  475. /\H\h\V\v/utf
  476. X X\x0a
  477. X\x09X\x0b
  478. \= Expect no match
  479. \x{a0} X\x0a
  480. /\H*\h+\V?\v{3,4}/utf,no_auto_possess
  481. \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
  482. \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a
  483. \x09\x20\x{a0}\x0a\x0b\x0c
  484. \= Expect no match
  485. \x09\x20\x{a0}\x0a\x0b
  486. /\H\h\V\v/utf
  487. \x{3001}\x{3000}\x{2030}\x{2028}
  488. X\x{180e}X\x{85}
  489. \= Expect no match
  490. \x{2009} X\x0a
  491. /\H*\h+\V?\v{3,4}/utf,no_auto_possess
  492. \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a
  493. \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a
  494. \x09\x20\x{202f}\x0a\x0b\x0c
  495. \= Expect no match
  496. \x09\x{200a}\x{a0}\x{2028}\x0b
  497. /a\Rb/I,bsr=anycrlf,utf
  498. a\rb
  499. a\nb
  500. a\r\nb
  501. \= Expect no match
  502. a\x{85}b
  503. a\x0bb
  504. /a\Rb/I,bsr=unicode,utf
  505. a\rb
  506. a\nb
  507. a\r\nb
  508. a\x{85}b
  509. a\x0bb
  510. /a\R?b/I,bsr=anycrlf,utf
  511. a\rb
  512. a\nb
  513. a\r\nb
  514. \= Expect no match
  515. a\x{85}b
  516. a\x0bb
  517. /a\R?b/I,bsr=unicode,utf
  518. a\rb
  519. a\nb
  520. a\r\nb
  521. a\x{85}b
  522. a\x0bb
  523. /X/newline=any,utf,firstline
  524. A\x{1ec5}ABCXYZ
  525. /abcd*/utf
  526. xxxxabcd\=ps
  527. xxxxabcd\=ph
  528. /abcd*/i,utf
  529. xxxxabcd\=ps
  530. xxxxabcd\=ph
  531. XXXXABCD\=ps
  532. XXXXABCD\=ph
  533. /abc\d*/utf
  534. xxxxabc1\=ps
  535. xxxxabc1\=ph
  536. /abc[de]*/utf
  537. xxxxabcde\=ps
  538. xxxxabcde\=ph
  539. /\bthe cat\b/utf
  540. the cat\=ps
  541. the cat\=ph
  542. /./newline=crlf,utf
  543. \r\=ps
  544. \r\=ph
  545. /.{2,3}/newline=crlf,utf
  546. \r\=ps
  547. \r\=ph
  548. \r\r\=ps
  549. \r\r\=ph
  550. \r\r\r\=ps
  551. \r\r\r\=ph
  552. /.{2,3}?/newline=crlf,utf
  553. \r\=ps
  554. \r\=ph
  555. \r\r\=ps
  556. \r\r\=ph
  557. \r\r\r\=ps
  558. \r\r\r\=ph
  559. /[^\x{100}]/utf
  560. \x{100}\x{101}X
  561. /[^\x{100}]+/utf
  562. \x{100}\x{101}X
  563. /\pL\P{Nd}/utf
  564. AB
  565. \= Expect no match
  566. A0
  567. 00
  568. /\X./utf
  569. AB
  570. A\x{300}BC
  571. A\x{300}\x{301}\x{302}BC
  572. \= Expect no match
  573. \x{300}
  574. /\X\X/utf
  575. ABC
  576. A\x{300}B\x{300}\x{301}C
  577. A\x{300}\x{301}\x{302}BC
  578. \= Expect no match
  579. \x{300}
  580. /^\pL+/utf
  581. abcd
  582. a
  583. /^\PL+/utf
  584. 1234
  585. =
  586. \= Expect no match
  587. abcd
  588. /^\X+/utf
  589. abcdA\x{300}\x{301}\x{302}
  590. A\x{300}\x{301}\x{302}
  591. A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}
  592. a
  593. \x{300}\x{301}\x{302}
  594. /\X?abc/utf
  595. abc
  596. A\x{300}abc
  597. A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
  598. \x{300}abc
  599. /^\X?abc/utf
  600. abc
  601. A\x{300}abc
  602. \x{300}abc
  603. \= Expect no match
  604. A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
  605. /\X*abc/utf
  606. abc
  607. A\x{300}abc
  608. A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
  609. \x{300}abc
  610. /^\X*abc/utf
  611. abc
  612. A\x{300}abc
  613. A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz
  614. \x{300}abc
  615. /^\pL?=./utf
  616. A=b
  617. =c
  618. \= Expect no match
  619. 1=2
  620. AAAA=b
  621. /^\pL*=./utf
  622. AAAA=b
  623. =c
  624. \= Expect no match
  625. 1=2
  626. /^\X{2,3}X/utf
  627. A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
  628. A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
  629. \= Expect no match
  630. X
  631. A\x{300}\x{301}\x{302}X
  632. A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X
  633. /^\pC\pL\pM\pN\pP\pS\pZ</utf
  634. \x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
  635. \np\x{300}9!\$ <
  636. \= Expect no match
  637. ap\x{300}9!\$ <
  638. /^\PC/utf
  639. X
  640. \= Expect no match
  641. \x7f
  642. /^\PL/utf
  643. 9
  644. \= Expect no match
  645. \x{c0}
  646. /^\PM/utf
  647. X
  648. \= Expect no match
  649. \x{30f}
  650. /^\PN/utf
  651. X
  652. \= Expect no match
  653. \x{660}
  654. /^\PP/utf
  655. X
  656. \= Expect no match
  657. \x{66c}
  658. /^\PS/utf
  659. X
  660. \= Expect no match
  661. \x{f01}
  662. /^\PZ/utf
  663. X
  664. \= Expect no match
  665. \x{1680}
  666. /^\p{Cc}/utf
  667. \x{017}
  668. \x{09f}
  669. \= Expect no match
  670. \x{0600}
  671. /^\p{Cf}/utf
  672. \x{601}
  673. \x{180e}
  674. \x{061c}
  675. \x{2066}
  676. \x{2067}
  677. \x{2068}
  678. \x{2069}
  679. \= Expect no match
  680. \x{09f}
  681. /^\p{Cn}/utf
  682. \= Expect no match
  683. \x{09f}
  684. /^\p{Co}/utf
  685. \x{f8ff}
  686. \= Expect no match
  687. \x{09f}
  688. /^\p{Cs}/utf
  689. \x{dfff}\=no_utf_check
  690. \= Expect no match
  691. \x{09f}
  692. /^\p{Ll}/utf
  693. a
  694. \= Expect no match
  695. Z
  696. \x{e000}
  697. /^\p{Lm}/utf
  698. \x{2b0}
  699. \= Expect no match
  700. a
  701. /^\p{Lo}/utf
  702. \x{1bb}
  703. \= Expect no match
  704. a
  705. \x{2b0}
  706. /^\p{Lt}/utf
  707. \x{1c5}
  708. \= Expect no match
  709. a
  710. \x{2b0}
  711. /^\p{Lu}/utf
  712. A
  713. \= Expect no match
  714. \x{2b0}
  715. /^\p{Mc}/utf
  716. \x{903}
  717. \= Expect no match
  718. X
  719. \x{300}
  720. /^\p{Me}/utf
  721. \x{488}
  722. \= Expect no match
  723. X
  724. \x{903}
  725. \x{300}
  726. /^\p{Mn}/utf
  727. \x{300}
  728. \x{1a1b}
  729. \= Expect no match
  730. X
  731. \x{903}
  732. /^\p{Nd}+/utf,no_auto_possess
  733. 0123456789\x{660}\x{661}\x{662}\x{663}\x{664}\x{665}\x{666}\x{667}\x{668}\x{669}\x{66a}
  734. \x{6f0}\x{6f1}\x{6f2}\x{6f3}\x{6f4}\x{6f5}\x{6f6}\x{6f7}\x{6f8}\x{6f9}\x{6fa}
  735. \x{966}\x{967}\x{968}\x{969}\x{96a}\x{96b}\x{96c}\x{96d}\x{96e}\x{96f}\x{970}
  736. \= Expect no match
  737. X
  738. /^\p{Nl}/utf
  739. \x{16ee}
  740. \= Expect no match
  741. X
  742. \x{966}
  743. /^\p{No}/utf
  744. \x{b2}
  745. \x{b3}
  746. \= Expect no match
  747. X
  748. \x{16ee}
  749. /^\p{Pc}/utf
  750. \x5f
  751. \x{203f}
  752. \= Expect no match
  753. X
  754. -
  755. \x{58a}
  756. /^\p{Pd}/utf
  757. -
  758. \x{58a}
  759. \= Expect no match
  760. X
  761. \x{203f}
  762. /^\p{Pe}/utf
  763. )
  764. ]
  765. }
  766. \x{f3b}
  767. \x{2309}
  768. \x{230b}
  769. \= Expect no match
  770. X
  771. \x{203f}
  772. (
  773. [
  774. {
  775. \x{f3c}
  776. /^\p{Pf}/utf
  777. \x{bb}
  778. \x{2019}
  779. \= Expect no match
  780. X
  781. \x{203f}
  782. /^\p{Pi}/utf
  783. \x{ab}
  784. \x{2018}
  785. \= Expect no match
  786. X
  787. \x{203f}
  788. /^\p{Po}/utf
  789. !
  790. \x{37e}
  791. \= Expect no match
  792. X
  793. \x{203f}
  794. /^\p{Ps}/utf
  795. (
  796. [
  797. {
  798. \x{f3c}
  799. \x{2308}
  800. \x{230a}
  801. \= Expect no match
  802. X
  803. )
  804. ]
  805. }
  806. \x{f3b}
  807. /^\p{Sc}+/utf
  808. $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6}
  809. \x{9f2}
  810. \= Expect no match
  811. X
  812. \x{2c2}
  813. /^\p{Sk}/utf
  814. \x{2c2}
  815. \= Expect no match
  816. X
  817. \x{9f2}
  818. /^\p{Sm}+/utf
  819. +<|~\x{ac}\x{2044}
  820. \= Expect no match
  821. X
  822. \x{9f2}
  823. /^\p{So}/utf
  824. \x{a6}
  825. \x{482}
  826. \= Expect no match
  827. X
  828. \x{9f2}
  829. /^\p{Zl}/utf
  830. \x{2028}
  831. \= Expect no match
  832. X
  833. \x{2029}
  834. /^\p{Zp}/utf
  835. \x{2029}
  836. \= Expect no match
  837. X
  838. \x{2028}
  839. /^\p{Zs}/utf
  840. \ \
  841. \x{a0}
  842. \x{1680}
  843. \x{2000}
  844. \x{2001}
  845. \= Expect no match
  846. \x{2028}
  847. \x{200d}
  848. /\p{Nd}+(..)/utf
  849. \x{660}\x{661}\x{662}ABC
  850. /\p{Nd}+?(..)/utf
  851. \x{660}\x{661}\x{662}ABC
  852. /\p{Nd}{2,}(..)/utf
  853. \x{660}\x{661}\x{662}ABC
  854. /\p{Nd}{2,}?(..)/utf
  855. \x{660}\x{661}\x{662}ABC
  856. /\p{Nd}*(..)/utf
  857. \x{660}\x{661}\x{662}ABC
  858. /\p{Nd}*?(..)/utf
  859. \x{660}\x{661}\x{662}ABC
  860. /\p{Nd}{2}(..)/utf
  861. \x{660}\x{661}\x{662}ABC
  862. /\p{Nd}{2,3}(..)/utf
  863. \x{660}\x{661}\x{662}ABC
  864. /\p{Nd}{2,3}?(..)/utf
  865. \x{660}\x{661}\x{662}ABC
  866. /\p{Nd}?(..)/utf
  867. \x{660}\x{661}\x{662}ABC
  868. /\p{Nd}??(..)/utf
  869. \x{660}\x{661}\x{662}ABC
  870. /\p{Nd}*+(..)/utf
  871. \x{660}\x{661}\x{662}ABC
  872. /\p{Nd}*+(...)/utf
  873. \x{660}\x{661}\x{662}ABC
  874. /\p{Nd}*+(....)/utf
  875. \= Expect no match
  876. \x{660}\x{661}\x{662}ABC
  877. /\p{Lu}/i,utf
  878. A
  879. a\x{10a0}B
  880. \= Expect no match
  881. a
  882. \x{1d00}
  883. /\p{^Lu}/i,utf
  884. 1234
  885. \= Expect no match
  886. ABC
  887. /\P{Lu}/i,utf
  888. 1234
  889. \= Expect no match
  890. ABC
  891. /(?<=A\p{Nd})XYZ/utf
  892. A2XYZ
  893. 123A5XYZPQR
  894. ABA\x{660}XYZpqr
  895. \= Expect no match
  896. AXYZ
  897. XYZ
  898. /(?<!\pL)XYZ/utf
  899. 1XYZ
  900. AB=XYZ..
  901. XYZ
  902. \= Expect no match
  903. WXYZ
  904. /[\p{Nd}]/utf
  905. 1234
  906. /[\p{Nd}+-]+/utf
  907. 1234
  908. 12-34
  909. 12+\x{661}-34
  910. \= Expect no match
  911. abcd
  912. /[\P{Nd}]+/utf
  913. abcd
  914. \= Expect no match
  915. 1234
  916. /\D+/utf,no_auto_possess
  917. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  918. \= Expect no match
  919. 11111111111111111111111111111111111111111111111111111111111111111111111
  920. /\P{Nd}+/utf,no_auto_possess
  921. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  922. \= Expect no match
  923. 11111111111111111111111111111111111111111111111111111111111111111111111
  924. /[\D]+/utf,no_auto_possess
  925. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  926. \= Expect no match
  927. 11111111111111111111111111111111111111111111111111111111111111111111111
  928. /[\P{Nd}]+/utf,no_auto_possess
  929. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  930. \= Expect no match
  931. 11111111111111111111111111111111111111111111111111111111111111111111111
  932. /[\D\P{Nd}]+/utf,no_auto_possess
  933. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  934. \= Expect no match
  935. 11111111111111111111111111111111111111111111111111111111111111111111111
  936. /\pL/utf
  937. a
  938. A
  939. /\pL/i,utf
  940. a
  941. A
  942. /\p{Lu}/utf
  943. A
  944. aZ
  945. \= Expect no match
  946. abc
  947. /\p{Lu}/i,utf
  948. A
  949. aZ
  950. \= Expect no match
  951. abc
  952. /\p{Ll}/utf
  953. a
  954. Az
  955. \= Expect no match
  956. ABC
  957. /\p{Ll}/i,utf
  958. a
  959. Az
  960. \= Expect no match
  961. ABC
  962. /^\x{c0}$/i,utf
  963. \x{c0}
  964. \x{e0}
  965. /^\x{e0}$/i,utf
  966. \x{c0}
  967. \x{e0}
  968. /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
  969. A\x{391}\x{10427}\x{ff3a}\x{1fb0}
  970. \= Expect no match
  971. a\x{391}\x{10427}\x{ff3a}\x{1fb0}
  972. A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
  973. A\x{391}\x{1044F}\x{ff3a}\x{1fb0}
  974. A\x{391}\x{10427}\x{ff5a}\x{1fb0}
  975. A\x{391}\x{10427}\x{ff3a}\x{1fb8}
  976. /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
  977. A\x{391}\x{10427}\x{ff3a}\x{1fb0}
  978. a\x{391}\x{10427}\x{ff3a}\x{1fb0}
  979. A\x{3b1}\x{10427}\x{ff3a}\x{1fb0}
  980. A\x{391}\x{1044F}\x{ff3a}\x{1fb0}
  981. A\x{391}\x{10427}\x{ff5a}\x{1fb0}
  982. A\x{391}\x{10427}\x{ff3a}\x{1fb8}
  983. /\x{391}+/i,utf
  984. \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}
  985. /\x{391}{3,5}(.)/i,utf
  986. \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X
  987. /\x{391}{3,5}?(.)/i,utf
  988. \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X
  989. /[\x{391}\x{ff3a}]/i,utf
  990. \x{391}
  991. \x{ff3a}
  992. \x{3b1}
  993. \x{ff5a}
  994. /[\x{c0}\x{391}]/i,utf
  995. \x{c0}
  996. \x{e0}
  997. /[\x{105}-\x{109}]/i,utf
  998. \x{104}
  999. \x{105}
  1000. \x{109}
  1001. \= Expect no match
  1002. \x{100}
  1003. \x{10a}
  1004. /[z-\x{100}]/i,utf
  1005. Z
  1006. z
  1007. \x{39c}
  1008. \x{178}
  1009. |
  1010. \x{80}
  1011. \x{ff}
  1012. \x{100}
  1013. \x{101}
  1014. \= Expect no match
  1015. \x{102}
  1016. Y
  1017. y
  1018. /[z-\x{100}]/i,utf
  1019. /^\X/utf
  1020. A
  1021. A\x{300}BC
  1022. A\x{300}\x{301}\x{302}BC
  1023. \x{300}
  1024. /^(\X*)C/utf
  1025. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}
  1026. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C
  1027. /^(\X*?)C/utf
  1028. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}
  1029. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C
  1030. /^(\X*)(.)/utf
  1031. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}
  1032. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C
  1033. /^(\X*?)(.)/utf
  1034. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}
  1035. A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C
  1036. /^\X(.)/utf
  1037. \= Expect no match
  1038. A\x{300}\x{301}\x{302}
  1039. /^\X{2,3}(.)/utf
  1040. A\x{300}\x{301}B\x{300}X
  1041. A\x{300}\x{301}B\x{300}C\x{300}\x{301}
  1042. A\x{300}\x{301}B\x{300}C\x{300}\x{301}X
  1043. A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X
  1044. /^\X{2,3}?(.)/utf
  1045. A\x{300}\x{301}B\x{300}X
  1046. A\x{300}\x{301}B\x{300}C\x{300}\x{301}
  1047. A\x{300}\x{301}B\x{300}C\x{300}\x{301}X
  1048. A\x{300}\x{301}B\x{300}C\x{300}\x{301}DA\x{300}X
  1049. /^\pN{2,3}X/
  1050. 12X
  1051. 123X
  1052. \= Expect no match
  1053. X
  1054. 1X
  1055. 1234X
  1056. /\x{100}/i,utf
  1057. \x{100}
  1058. \x{101}
  1059. /^\p{Han}+/utf
  1060. \x{2e81}\x{3007}\x{2f804}\x{31a0}
  1061. \= Expect no match
  1062. \x{2e7f}
  1063. /^\P{Katakana}+/utf
  1064. \x{3105}
  1065. \= Expect no match
  1066. \x{30ff}
  1067. /^[\p{Arabic}]/utf
  1068. \x{06e9}
  1069. \x{060b}
  1070. \= Expect no match
  1071. X\x{06e9}
  1072. /^[\P{Yi}]/utf
  1073. \x{2f800}
  1074. \= Expect no match
  1075. \x{a014}
  1076. \x{a4c6}
  1077. /^\p{Any}X/utf
  1078. AXYZ
  1079. \x{1234}XYZ
  1080. \= Expect no match
  1081. X
  1082. /^\P{Any}X/utf
  1083. \= Expect no match
  1084. AX
  1085. /^\p{Any}?X/utf
  1086. XYZ
  1087. AXYZ
  1088. \x{1234}XYZ
  1089. \= Expect no match
  1090. ABXYZ
  1091. /^\P{Any}?X/utf
  1092. XYZ
  1093. \= Expect no match
  1094. AXYZ
  1095. \x{1234}XYZ
  1096. ABXYZ
  1097. /^\p{Any}+X/utf
  1098. AXYZ
  1099. \x{1234}XYZ
  1100. A\x{1234}XYZ
  1101. \= Expect no match
  1102. XYZ
  1103. /^\P{Any}+X/utf
  1104. \= Expect no match
  1105. AXYZ
  1106. \x{1234}XYZ
  1107. A\x{1234}XYZ
  1108. XYZ
  1109. /^\p{Any}*X/utf
  1110. XYZ
  1111. AXYZ
  1112. \x{1234}XYZ
  1113. A\x{1234}XYZ
  1114. /^\P{Any}*X/utf
  1115. XYZ
  1116. \= Expect no match
  1117. AXYZ
  1118. \x{1234}XYZ
  1119. A\x{1234}XYZ
  1120. /^[\p{Any}]X/utf
  1121. AXYZ
  1122. \x{1234}XYZ
  1123. \= Expect no match
  1124. X
  1125. /^[\P{Any}]X/utf
  1126. \= Expect no match
  1127. AX
  1128. /^[\p{Any}]?X/utf
  1129. XYZ
  1130. AXYZ
  1131. \x{1234}XYZ
  1132. \= Expect no match
  1133. ABXYZ
  1134. /^[\P{Any}]?X/utf
  1135. XYZ
  1136. \= Expect no match
  1137. AXYZ
  1138. \x{1234}XYZ
  1139. ABXYZ
  1140. /^[\p{Any}]+X/utf
  1141. AXYZ
  1142. \x{1234}XYZ
  1143. A\x{1234}XYZ
  1144. \= Expect no match
  1145. XYZ
  1146. /^[\P{Any}]+X/utf
  1147. \= Expect no match
  1148. AXYZ
  1149. \x{1234}XYZ
  1150. A\x{1234}XYZ
  1151. XYZ
  1152. /^[\p{Any}]*X/utf
  1153. XYZ
  1154. AXYZ
  1155. \x{1234}XYZ
  1156. A\x{1234}XYZ
  1157. /^[\P{Any}]*X/utf
  1158. XYZ
  1159. \= Expect no match
  1160. AXYZ
  1161. \x{1234}XYZ
  1162. A\x{1234}XYZ
  1163. /^\p{Any}{3,5}?/utf
  1164. abcdefgh
  1165. \x{1234}\n\r\x{3456}xyz
  1166. /^\p{Any}{3,5}/utf
  1167. abcdefgh
  1168. \x{1234}\n\r\x{3456}xyz
  1169. /^\P{Any}{3,5}?/utf
  1170. \= Expect no match
  1171. abcdefgh
  1172. \x{1234}\n\r\x{3456}xyz
  1173. /^\p{L&}X/utf
  1174. AXY
  1175. aXY
  1176. \x{1c5}XY
  1177. \= Expect no match
  1178. \x{1bb}XY
  1179. \x{2b0}XY
  1180. !XY
  1181. /^[\p{L&}]X/utf
  1182. AXY
  1183. aXY
  1184. \x{1c5}XY
  1185. \= Expect no match
  1186. \x{1bb}XY
  1187. \x{2b0}XY
  1188. !XY
  1189. /^\p{L&}+X/utf
  1190. AXY
  1191. aXY
  1192. AbcdeXyz
  1193. \x{1c5}AbXY
  1194. abcDEXypqreXlmn
  1195. \= Expect no match
  1196. \x{1bb}XY
  1197. \x{2b0}XY
  1198. !XY
  1199. /^[\p{L&}]+X/utf
  1200. AXY
  1201. aXY
  1202. AbcdeXyz
  1203. \x{1c5}AbXY
  1204. abcDEXypqreXlmn
  1205. \= Expect no match
  1206. \x{1bb}XY
  1207. \x{2b0}XY
  1208. !XY
  1209. /^\p{L&}+?X/utf
  1210. AXY
  1211. aXY
  1212. AbcdeXyz
  1213. \x{1c5}AbXY
  1214. abcDEXypqreXlmn
  1215. \= Expect no match
  1216. \x{1bb}XY
  1217. \x{2b0}XY
  1218. !XY
  1219. /^[\p{L&}]+?X/utf
  1220. AXY
  1221. aXY
  1222. AbcdeXyz
  1223. \x{1c5}AbXY
  1224. abcDEXypqreXlmn
  1225. \= Expect no match
  1226. \x{1bb}XY
  1227. \x{2b0}XY
  1228. !XY
  1229. /^\P{L&}X/utf
  1230. !XY
  1231. \x{1bb}XY
  1232. \x{2b0}XY
  1233. \= Expect no match
  1234. \x{1c5}XY
  1235. AXY
  1236. /^[\P{L&}]X/utf
  1237. !XY
  1238. \x{1bb}XY
  1239. \x{2b0}XY
  1240. \= Expect no match
  1241. \x{1c5}XY
  1242. AXY
  1243. /^\x{023a}+?(\x{0130}+)/i,utf
  1244. \x{023a}\x{2c65}\x{0130}
  1245. /^\x{023a}+([^X])/i,utf
  1246. \x{023a}\x{2c65}X
  1247. /\x{c0}+\x{116}+/i,utf
  1248. \x{c0}\x{e0}\x{116}\x{117}
  1249. /[\x{c0}\x{116}]+/i,utf
  1250. \x{c0}\x{e0}\x{116}\x{117}
  1251. # Check property support in non-UTF-8 mode
  1252. /\p{L}{4}/
  1253. 123abcdefg
  1254. 123abc\xc4\xc5zz
  1255. /\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/utf
  1256. \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}====
  1257. /\x{a77d}\x{1d79}/i,utf
  1258. \x{a77d}\x{1d79}
  1259. \x{1d79}\x{a77d}
  1260. /\x{a77d}\x{1d79}/utf
  1261. \x{a77d}\x{1d79}
  1262. \= Expect no match
  1263. \x{1d79}\x{a77d}
  1264. /^\p{Xan}/utf
  1265. ABCD
  1266. 1234
  1267. \x{6ca}
  1268. \x{a6c}
  1269. \x{10a7}
  1270. \= Expect no match
  1271. _ABC
  1272. /^\p{Xan}+/utf
  1273. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1274. \= Expect no match
  1275. _ABC
  1276. /^\p{Xan}*/utf
  1277. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1278. /^\p{Xan}{2,9}/utf
  1279. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1280. /^[\p{Xan}]/utf
  1281. ABCD1234_
  1282. 1234abcd_
  1283. \x{6ca}
  1284. \x{a6c}
  1285. \x{10a7}
  1286. \= Expect no match
  1287. _ABC
  1288. /^[\p{Xan}]+/utf
  1289. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1290. \= Expect no match
  1291. _ABC
  1292. /^>\p{Xsp}/utf
  1293. >\x{1680}\x{2028}\x{0b}
  1294. \= Expect no match
  1295. \x{0b}
  1296. /^>\p{Xsp}+/utf,no_auto_possess
  1297. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1298. /^>\p{Xsp}*/utf,no_auto_possess
  1299. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1300. /^>\p{Xsp}{2,9}/utf,no_auto_possess
  1301. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1302. /^>[\p{Xsp}]/utf,no_auto_possess
  1303. >\x{2028}\x{0b}
  1304. /^>[\p{Xsp}]+/utf,no_auto_possess
  1305. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1306. /^>\p{Xps}/utf
  1307. >\x{1680}\x{2028}\x{0b}
  1308. >\x{a0}
  1309. \= Expect no match
  1310. \x{0b}
  1311. /^>\p{Xps}+/utf
  1312. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1313. /^>\p{Xps}+?/utf
  1314. >\x{1680}\x{2028}\x{0b}
  1315. /^>\p{Xps}*/utf
  1316. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1317. /^>\p{Xps}{2,9}/utf
  1318. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1319. /^>\p{Xps}{2,9}?/utf
  1320. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1321. /^>[\p{Xps}]/utf
  1322. >\x{2028}\x{0b}
  1323. /^>[\p{Xps}]+/utf
  1324. > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
  1325. /^\p{Xwd}/utf
  1326. ABCD
  1327. 1234
  1328. \x{6ca}
  1329. \x{a6c}
  1330. \x{10a7}
  1331. _ABC
  1332. \= Expect no match
  1333. []
  1334. /^\p{Xwd}+/utf
  1335. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1336. /^\p{Xwd}*/utf
  1337. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1338. /^\p{Xwd}{2,9}/utf
  1339. A_12\x{6ca}\x{a6c}\x{10a7}
  1340. /^[\p{Xwd}]/utf
  1341. ABCD1234_
  1342. 1234abcd_
  1343. \x{6ca}
  1344. \x{a6c}
  1345. \x{10a7}
  1346. _ABC
  1347. \= Expect no match
  1348. []
  1349. /^[\p{Xwd}]+/utf
  1350. ABCD1234\x{6ca}\x{a6c}\x{10a7}_
  1351. # Unicode properties for \b and \B
  1352. /\b...\B/utf,ucp
  1353. abc_
  1354. \x{37e}abc\x{376}
  1355. \x{37e}\x{376}\x{371}\x{393}\x{394}
  1356. !\x{c0}++\x{c1}\x{c2}
  1357. !\x{c0}+++++
  1358. # Without PCRE_UCP, non-ASCII always fail, even if < 256
  1359. /\b...\B/utf
  1360. abc_
  1361. \= Expect no match
  1362. \x{37e}abc\x{376}
  1363. \x{37e}\x{376}\x{371}\x{393}\x{394}
  1364. !\x{c0}++\x{c1}\x{c2}
  1365. !\x{c0}+++++
  1366. # With PCRE_UCP, non-UTF8 chars that are < 256 still check properties
  1367. /\b...\B/ucp
  1368. abc_
  1369. !\x{c0}++\x{c1}\x{c2}
  1370. !\x{c0}+++++
  1371. # Caseless single negated characters > 127 need UCP support
  1372. /[^\x{100}]/i,utf
  1373. \x{100}\x{101}X
  1374. /[^\x{100}]+/i,utf
  1375. \x{100}\x{101}XX
  1376. /^\X/utf
  1377. A\=ps
  1378. A\=ph
  1379. A\x{300}\x{301}\=ps
  1380. A\x{300}\x{301}\=ph
  1381. A\x{301}\=ps
  1382. A\x{301}\=ph
  1383. /^\X{2,3}/utf
  1384. A\=ps
  1385. A\=ph
  1386. AA\=ps
  1387. AA\=ph
  1388. A\x{300}\x{301}\=ps
  1389. A\x{300}\x{301}\=ph
  1390. A\x{300}\x{301}A\x{300}\x{301}\=ps
  1391. A\x{300}\x{301}A\x{300}\x{301}\=ph
  1392. /^\X{2}/utf
  1393. AA\=ps
  1394. AA\=ph
  1395. A\x{300}\x{301}A\x{300}\x{301}\=ps
  1396. A\x{300}\x{301}A\x{300}\x{301}\=ph
  1397. /^\X+/utf
  1398. AA\=ps
  1399. AA\=ph
  1400. /^\X+?Z/utf
  1401. AA\=ps
  1402. AA\=ph
  1403. # These are tests for extended grapheme clusters
  1404. /^\X/utf,aftertext
  1405. G\x{34e}\x{34e}X
  1406. \x{34e}\x{34e}X
  1407. \x04X
  1408. \x{1100}X
  1409. \x{1100}\x{34e}X
  1410. \x{1b04}\x{1b04}X
  1411. \= These match up to the roman letters
  1412. \x{1111}\x{1111}L,L
  1413. \x{1111}\x{1111}\x{1169}L,L,V
  1414. \x{1111}\x{ae4c}L, LV
  1415. \x{1111}\x{ad89}L, LVT
  1416. \x{1111}\x{ae4c}\x{1169}L, LV, V
  1417. \x{1111}\x{ae4c}\x{1169}\x{1169}L, LV, V, V
  1418. \x{1111}\x{ae4c}\x{1169}\x{11fe}L, LV, V, T
  1419. \x{1111}\x{ad89}\x{11fe}L, LVT, T
  1420. \x{1111}\x{ad89}\x{11fe}\x{11fe}L, LVT, T, T
  1421. \x{ad89}\x{11fe}\x{11fe}LVT, T, T
  1422. \= These match just the first codepoint (invalid sequence)
  1423. \x{1111}\x{11fe}L, T
  1424. \x{ae4c}\x{1111}LV, L
  1425. \x{ae4c}\x{ae4c}LV, LV
  1426. \x{ae4c}\x{ad89}LV, LVT
  1427. \x{1169}\x{1111}V, L
  1428. \x{1169}\x{ae4c}V, LV
  1429. \x{1169}\x{ad89}V, LVT
  1430. \x{ad89}\x{1111}LVT, L
  1431. \x{ad89}\x{1169}LVT, V
  1432. \x{ad89}\x{ae4c}LVT, LV
  1433. \x{ad89}\x{ad89}LVT, LVT
  1434. \x{11fe}\x{1111}T, L
  1435. \x{11fe}\x{1169}T, V
  1436. \x{11fe}\x{ae4c}T, LV
  1437. \x{11fe}\x{ad89}T, LVT
  1438. \= Test extend and spacing mark
  1439. \x{1111}\x{ae4c}\x{0711}L, LV, extend
  1440. \x{1111}\x{ae4c}\x{1b04}L, LV, spacing mark
  1441. \x{1111}\x{ae4c}\x{1b04}\x{0711}\x{1b04}L, LV, spacing mark, extend, spacing mark
  1442. \= Test CR, LF, and control
  1443. \x0d\x{0711}CR, extend
  1444. \x0d\x{1b04}CR, spacingmark
  1445. \x0a\x{0711}LF, extend
  1446. \x0a\x{1b04}LF, spacingmark
  1447. \x0b\x{0711}Control, extend
  1448. \x09\x{1b04}Control, spacingmark
  1449. \= There are no Prepend characters, so we can't test Prepend, CR
  1450. /^(?>\X{2})X/utf,aftertext
  1451. \x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1452. /^\X{2,4}X/utf,aftertext
  1453. \x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1454. \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1455. \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1456. /^\X{2,4}?X/utf,aftertext
  1457. \x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1458. \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1459. \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
  1460. /\x{1e9e}+/i,utf
  1461. \x{1e9e}\x{00df}
  1462. /[z\x{1e9e}]+/i,utf
  1463. \x{1e9e}\x{00df}
  1464. /\x{00df}+/i,utf
  1465. \x{1e9e}\x{00df}
  1466. /[z\x{00df}]+/i,utf
  1467. \x{1e9e}\x{00df}
  1468. /\x{1f88}+/i,utf
  1469. \x{1f88}\x{1f80}
  1470. /[z\x{1f88}]+/i,utf
  1471. \x{1f88}\x{1f80}
  1472. # Perl matches these
  1473. /\x{00b5}+/i,utf
  1474. \x{00b5}\x{039c}\x{03bc}
  1475. /\x{039c}+/i,utf
  1476. \x{00b5}\x{039c}\x{03bc}
  1477. /\x{03bc}+/i,utf
  1478. \x{00b5}\x{039c}\x{03bc}
  1479. /\x{00c5}+/i,utf
  1480. \x{00c5}\x{00e5}\x{212b}
  1481. /\x{00e5}+/i,utf
  1482. \x{00c5}\x{00e5}\x{212b}
  1483. /\x{212b}+/i,utf
  1484. \x{00c5}\x{00e5}\x{212b}
  1485. /\x{01c4}+/i,utf
  1486. \x{01c4}\x{01c5}\x{01c6}
  1487. /\x{01c5}+/i,utf
  1488. \x{01c4}\x{01c5}\x{01c6}
  1489. /\x{01c6}+/i,utf
  1490. \x{01c4}\x{01c5}\x{01c6}
  1491. /\x{01c7}+/i,utf
  1492. \x{01c7}\x{01c8}\x{01c9}
  1493. /\x{01c8}+/i,utf
  1494. \x{01c7}\x{01c8}\x{01c9}
  1495. /\x{01c9}+/i,utf
  1496. \x{01c7}\x{01c8}\x{01c9}
  1497. /\x{01ca}+/i,utf
  1498. \x{01ca}\x{01cb}\x{01cc}
  1499. /\x{01cb}+/i,utf
  1500. \x{01ca}\x{01cb}\x{01cc}
  1501. /\x{01cc}+/i,utf
  1502. \x{01ca}\x{01cb}\x{01cc}
  1503. /\x{01f1}+/i,utf
  1504. \x{01f1}\x{01f2}\x{01f3}
  1505. /\x{01f2}+/i,utf
  1506. \x{01f1}\x{01f2}\x{01f3}
  1507. /\x{01f3}+/i,utf
  1508. \x{01f1}\x{01f2}\x{01f3}
  1509. /\x{0345}+/i,utf
  1510. \x{0345}\x{0399}\x{03b9}\x{1fbe}
  1511. /\x{0399}+/i,utf
  1512. \x{0345}\x{0399}\x{03b9}\x{1fbe}
  1513. /\x{03b9}+/i,utf
  1514. \x{0345}\x{0399}\x{03b9}\x{1fbe}
  1515. /\x{1fbe}+/i,utf
  1516. \x{0345}\x{0399}\x{03b9}\x{1fbe}
  1517. /\x{0392}+/i,utf
  1518. \x{0392}\x{03b2}\x{03d0}
  1519. /\x{03b2}+/i,utf
  1520. \x{0392}\x{03b2}\x{03d0}
  1521. /\x{03d0}+/i,utf
  1522. \x{0392}\x{03b2}\x{03d0}
  1523. /\x{0395}+/i,utf
  1524. \x{0395}\x{03b5}\x{03f5}
  1525. /\x{03b5}+/i,utf
  1526. \x{0395}\x{03b5}\x{03f5}
  1527. /\x{03f5}+/i,utf
  1528. \x{0395}\x{03b5}\x{03f5}
  1529. /\x{0398}+/i,utf
  1530. \x{0398}\x{03b8}\x{03d1}\x{03f4}
  1531. /\x{03b8}+/i,utf
  1532. \x{0398}\x{03b8}\x{03d1}\x{03f4}
  1533. /\x{03d1}+/i,utf
  1534. \x{0398}\x{03b8}\x{03d1}\x{03f4}
  1535. /\x{03f4}+/i,utf
  1536. \x{0398}\x{03b8}\x{03d1}\x{03f4}
  1537. /\x{039a}+/i,utf
  1538. \x{039a}\x{03ba}\x{03f0}
  1539. /\x{03ba}+/i,utf
  1540. \x{039a}\x{03ba}\x{03f0}
  1541. /\x{03f0}+/i,utf
  1542. \x{039a}\x{03ba}\x{03f0}
  1543. /\x{03a0}+/i,utf
  1544. \x{03a0}\x{03c0}\x{03d6}
  1545. /\x{03c0}+/i,utf
  1546. \x{03a0}\x{03c0}\x{03d6}
  1547. /\x{03d6}+/i,utf
  1548. \x{03a0}\x{03c0}\x{03d6}
  1549. /\x{03a1}+/i,utf
  1550. \x{03a1}\x{03c1}\x{03f1}
  1551. /\x{03c1}+/i,utf
  1552. \x{03a1}\x{03c1}\x{03f1}
  1553. /\x{03f1}+/i,utf
  1554. \x{03a1}\x{03c1}\x{03f1}
  1555. /\x{03a3}+/i,utf
  1556. \x{03A3}\x{03C2}\x{03C3}
  1557. /\x{03c2}+/i,utf
  1558. \x{03A3}\x{03C2}\x{03C3}
  1559. /\x{03c3}+/i,utf
  1560. \x{03A3}\x{03C2}\x{03C3}
  1561. /\x{03a6}+/i,utf
  1562. \x{03a6}\x{03c6}\x{03d5}
  1563. /\x{03c6}+/i,utf
  1564. \x{03a6}\x{03c6}\x{03d5}
  1565. /\x{03d5}+/i,utf
  1566. \x{03a6}\x{03c6}\x{03d5}
  1567. /\x{03c9}+/i,utf
  1568. \x{03c9}\x{03a9}\x{2126}
  1569. /\x{03a9}+/i,utf
  1570. \x{03c9}\x{03a9}\x{2126}
  1571. /\x{2126}+/i,utf
  1572. \x{03c9}\x{03a9}\x{2126}
  1573. /\x{1e60}+/i,utf
  1574. \x{1e60}\x{1e61}\x{1e9b}
  1575. /\x{1e61}+/i,utf
  1576. \x{1e60}\x{1e61}\x{1e9b}
  1577. /\x{1e9b}+/i,utf
  1578. \x{1e60}\x{1e61}\x{1e9b}
  1579. /\x{1e9e}+/i,utf
  1580. \x{1e9e}\x{00df}
  1581. /\x{00df}+/i,utf
  1582. \x{1e9e}\x{00df}
  1583. /\x{1f88}+/i,utf
  1584. \x{1f88}\x{1f80}
  1585. /\x{1f80}+/i,utf
  1586. \x{1f88}\x{1f80}
  1587. /\x{004b}+/i,utf
  1588. \x{004b}\x{006b}\x{212a}
  1589. /\x{006b}+/i,utf
  1590. \x{004b}\x{006b}\x{212a}
  1591. /\x{212a}+/i,utf
  1592. \x{004b}\x{006b}\x{212a}
  1593. /\x{0053}+/i,utf
  1594. \x{0053}\x{0073}\x{017f}
  1595. /\x{0073}+/i,utf
  1596. \x{0053}\x{0073}\x{017f}
  1597. /\x{017f}+/i,utf
  1598. \x{0053}\x{0073}\x{017f}
  1599. /ist/i,utf
  1600. \= Expect no match
  1601. ikt
  1602. /is+t/i,utf
  1603. iSs\x{17f}t
  1604. \= Expect no match
  1605. ikt
  1606. /is+?t/i,utf
  1607. \= Expect no match
  1608. ikt
  1609. /is?t/i,utf
  1610. \= Expect no match
  1611. ikt
  1612. /is{2}t/i,utf
  1613. \= Expect no match
  1614. iskt
  1615. /^\p{Xuc}/utf
  1616. $abc
  1617. @abc
  1618. `abc
  1619. \x{1234}abc
  1620. \= Expect no match
  1621. abc
  1622. /^\p{Xuc}+/utf
  1623. $@`\x{a0}\x{1234}\x{e000}**
  1624. \= Expect no match
  1625. \x{9f}
  1626. /^\p{Xuc}+?/utf
  1627. $@`\x{a0}\x{1234}\x{e000}**
  1628. \= Expect no match
  1629. \x{9f}
  1630. /^\p{Xuc}+?\*/utf
  1631. $@`\x{a0}\x{1234}\x{e000}**
  1632. \= Expect no match
  1633. \x{9f}
  1634. /^\p{Xuc}++/utf
  1635. $@`\x{a0}\x{1234}\x{e000}**
  1636. \= Expect no match
  1637. \x{9f}
  1638. /^\p{Xuc}{3,5}/utf
  1639. $@`\x{a0}\x{1234}\x{e000}**
  1640. \= Expect no match
  1641. \x{9f}
  1642. /^\p{Xuc}{3,5}?/utf
  1643. $@`\x{a0}\x{1234}\x{e000}**
  1644. \= Expect no match
  1645. \x{9f}
  1646. /^[\p{Xuc}]/utf
  1647. $@`\x{a0}\x{1234}\x{e000}**
  1648. \= Expect no match
  1649. \x{9f}
  1650. /^[\p{Xuc}]+/utf
  1651. $@`\x{a0}\x{1234}\x{e000}**
  1652. \= Expect no match
  1653. \x{9f}
  1654. /^\P{Xuc}/utf
  1655. abc
  1656. \= Expect no match
  1657. $abc
  1658. @abc
  1659. `abc
  1660. \x{1234}abc
  1661. /^[\P{Xuc}]/utf
  1662. abc
  1663. \= Expect no match
  1664. $abc
  1665. @abc
  1666. `abc
  1667. \x{1234}abc
  1668. /^A\s+Z/utf,ucp
  1669. A\x{2005}Z
  1670. A\x{85}\x{180e}\x{2005}Z
  1671. /^A[\s]+Z/utf,ucp
  1672. A\x{2005}Z
  1673. A\x{85}\x{180e}\x{2005}Z
  1674. /(?<=\x{100})\x{200}(?=\x{300})/utf,allusedtext
  1675. \x{100}\x{200}\x{300}
  1676. # -----------------------------------------------------------------------------
  1677. # Tests for bidi control and bidi class properties
  1678. /\p{ bidi_control }/utf
  1679. -->\x{202c}<--
  1680. /\p{bidicontrol}+/utf
  1681. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1682. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1683. /\p{bidicontrol}+?/utf
  1684. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1685. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1686. /\p{bidicontrol}++/utf
  1687. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1688. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1689. /[\p{bidi_control}]/utf
  1690. -->\x{202c}<--
  1691. /[\p{bidicontrol}]+/utf
  1692. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1693. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1694. /[\p{bidicontrol}]+?/utf
  1695. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1696. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1697. /[\p{bidicontrol}]++/utf
  1698. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1699. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1700. /[\p{bidicontrol}<>]+/utf
  1701. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1702. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1703. /\P{bidicontrol}+/g,utf
  1704. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1705. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1706. /\p{^bidicontrol}+/g,utf
  1707. -->\x{061c}\x{200e}\x{200f}\x{202a}\x{202b}\x{202c}\x{202d}<--
  1708. -->\x{2066}\x{2067}\x{2068}\x{2069}<--
  1709. /\p{bidi class = al}/utf
  1710. -->\x{061D}<--
  1711. /\p{bidi class = al}+/utf
  1712. -->\x{061D}\x{061e}\x{061f}<--
  1713. /\p{bidi_class : AL}+?/utf
  1714. -->\x{061D}\x{061e}\x{061f}<--
  1715. /\p{Bidi_Class : AL}++/utf
  1716. -->\x{061D}\x{061e}\x{061f}<--
  1717. /\p{bidi class = aN}+/utf
  1718. -->\x{061D}\x{0602}\x{0604}\x{061f}<--
  1719. /\p{bidi class = B}+/utf
  1720. -->\x{0a}\x{0d}\x{01c}\x{01e}\x{085}\x{2029}<--
  1721. /\p{bidi class:BN}+/utf
  1722. -->\x{0}\x{08}\x{200c}\x{fffe}\x{dfffe}\x{10ffff}<--
  1723. /\p{bidiclass:cs}+/utf
  1724. -->,.\x{060c}\x{ff1a}<--
  1725. /\p{bidiclass:En}+/utf
  1726. -->09\x{b2}\x{2074}\x{1fbf9}<--
  1727. /\p{bidiclass:es}+/utf
  1728. ==>+-\x{207a}\x{ff0d}<==
  1729. /\p{bidiclass:et}+/utf
  1730. -->#\{24}%\x{a2}\x{A838}\x{1e2ff}<--
  1731. /\p{bidiclass:FSI}+/utf
  1732. -->\x{2068}<--
  1733. /\p{bidi class:L}+/utf
  1734. -->ABC<--
  1735. /\P{bidi class:L}+/utf
  1736. -->ABC<--
  1737. /\p{bidi class:LRE}+\p{bidiclass=lri}*\p{bidiclass:lro}/utf
  1738. -->\x{202a}\x{2066}\x{202d}<--
  1739. /\p{bidi class:NSM}+/utf
  1740. -->\x{9bc}\x{a71}\x{e31}<--
  1741. /\p{bidi class:ON}+/utf
  1742. -->\x{21}'()*;@\x{384}\x{2039}<=-
  1743. /\p{bidiclass:pdf}\p{bidiclass:pdi}/utf
  1744. -->\x{202c}\x{2069}<--
  1745. /\p{bidi class:R}+/utf
  1746. -->\x{590}\x{5c6}\x{200f}\x{10805}<--
  1747. /\p{bidi class:RLE}+\p{bidi class:RLI}*\p{bidi class:RLO}+/utf
  1748. -->\x{202b}\x{2067}\x{202e}<--
  1749. /\p{bidi class:S}+\p{bidiclass:WS}+/utf
  1750. -->\x{9}\x{b}\x{1f} \x{c} \x{2000} \x{3000}<--
  1751. # -----------------------------------------------------------------------------
  1752. /\p{katakana}/utf
  1753. \x{30a1}
  1754. \x{3001}
  1755. /\p{scx:katakana}/utf
  1756. \x{30a1}
  1757. \x{3001}
  1758. /\p{script extensions:katakana}/utf
  1759. \x{30a1}
  1760. \x{3001}
  1761. /\p{sc:katakana}/utf
  1762. \x{30a1}
  1763. \= Expect no match
  1764. \x{3001}
  1765. /\p{script:katakana}/utf
  1766. \x{30a1}
  1767. \= Expect no match
  1768. \x{3001}
  1769. /\p{sc:katakana}{3,}/utf
  1770. \x{30a1}\x{30fa}\x{32d0}\x{1b122}\x{ff66}\x{3001}ABC
  1771. /\p{sc:katakana}{3,}?/utf
  1772. \x{30a1}\x{30fa}\x{32d0}\x{1b122}\x{ff66}\x{3001}ABC
  1773. # Tests for PCRE2_EXTRA_CASELESS_RESTRICT. Compare each test with and without
  1774. # the restriction.
  1775. /AskZ/i,utf,caseless_restrict
  1776. AskZ
  1777. aSKz
  1778. \= Expect no match
  1779. A\x{17f}kZ
  1780. As\x{212a}Z
  1781. /AskZ/i,utf
  1782. AskZ
  1783. aSKz
  1784. A\x{17f}kZ
  1785. As\x{212a}Z
  1786. /A\x{17f}\x{212a}Z/ir,utf
  1787. \= Expect no match
  1788. AskZ
  1789. /A\x{17f}\x{212a}Z/i,utf
  1790. AskZ
  1791. /[AskZ]+/i,utf,caseless_restrict
  1792. AskZ
  1793. aSKz
  1794. A\x{17f}kZ
  1795. As\x{212a}Z
  1796. /[AskZ]+/i,utf
  1797. AskZ
  1798. aSKz
  1799. A\x{17f}kZ
  1800. As\x{212a}Z
  1801. /[\x{17f}\x{212a}]+/ir,utf
  1802. \= Expect no match
  1803. AskZ
  1804. /[\x{17f}\x{212a}]+/i,utf
  1805. AskZ
  1806. /[^s]+/ir,utf
  1807. A\x{17f}Z
  1808. /[^s]+/i,utf
  1809. A\x{17f}Z
  1810. /[^k]+/ir,utf
  1811. A\x{212a}Z
  1812. /[^k]+/i,utf
  1813. A\x{212a}Z
  1814. /[^sk]+/ir,utf
  1815. A\x{17f}\x{212a}Z
  1816. /[^sk]+/i,utf
  1817. A\x{17f}\x{212a}Z
  1818. /[^\x{17f}]+/ir,utf
  1819. AsSZ
  1820. /[^\x{17f}]+/i,utf
  1821. AsSZ
  1822. /[Ss]+/irB,utf
  1823. Sss\x{17f}ss
  1824. /[Ss]+/iB,utf
  1825. Sss\x{17f}ss
  1826. /[S\x{17f}]/irB,utf
  1827. /[S\x{17f}]/iB,utf
  1828. /[\x{17f}s]/irB,utf
  1829. /[\x{17f}s]/iB,utf
  1830. /[\x{4b}\x{6b}]/irB,utf
  1831. /[\x{4b}\x{6b}]/iB,utf
  1832. /s(?r)s(?-r)s(?r:s)s/i,utf
  1833. \x{17f}S\x{17f}S\x{17f}
  1834. \= Expect no match
  1835. \x{17f}\x{17f}\x{17f}S\x{17f}
  1836. \x{17f}S\x{17f}\x{17f}\x{17f}
  1837. /k(?^i)k/ir,utf
  1838. K\x{212a}
  1839. \= Expect no match
  1840. \x{212a}\x{212a}
  1841. # End caseless restrict tests
  1842. # TESTS for PCRE2_EXTRA_ASCII_xxx - again, tests with and without.
  1843. # DIGITS
  1844. /\d+/i,utf
  1845. 123\x{660}456
  1846. /\d+/i,utf,ucp
  1847. 123\x{660}456
  1848. /\d+/i,utf,ucp,ascii_bsd
  1849. 123\x{660}456
  1850. /[\d]+/i,utf
  1851. 123\x{660}456
  1852. /[\d]+/i,utf,ucp
  1853. 123\x{660}456
  1854. /[\d]+/i,utf,ucp,ascii_bsd
  1855. 123\x{660}456
  1856. /\d(?aD)\d(?-aD)\d/utf,ucp
  1857. \x{660}9\x{660}
  1858. \= Expect no match
  1859. \x{660}\x{660}\x{660}
  1860. /\d(?-aD)\d(?aD)\d/utf,ucp,ascii_bsd
  1861. 999
  1862. 9\x{660}9
  1863. /\d(?a)\d(?-a)\d/utf,ucp
  1864. \x{660}9\x{660}
  1865. \= Expect no match
  1866. \x{660}\x{660}\x{660}
  1867. /\d(?-aD)\d(?aD)\d/utf,ucp,ascii_bsd
  1868. 999
  1869. 9\x{660}9
  1870. # SPACES
  1871. />\s+</i,utf
  1872. > <
  1873. \= Expect no match
  1874. >\x{a0} <
  1875. />\s+</i,utf,ucp
  1876. > <
  1877. >\x{a0} <
  1878. />\s+</i,utf,ucp,ascii_bss
  1879. > <
  1880. \= Expect no match
  1881. >\x{a0} <
  1882. />[\s]+</i,utf
  1883. > <
  1884. \= Expect no match
  1885. >\x{a0} <
  1886. />[\s]+</i,utf,ucp
  1887. > <
  1888. >\x{a0} <
  1889. />[\s]+</i,utf,ucp,ascii_bss
  1890. > <
  1891. \= Expect no match
  1892. >\x{a0} <
  1893. />\s(?aS)\s(?-aS)\s</utf,ucp
  1894. >\x{a0} \x{a0}<
  1895. \= Expect no match
  1896. >\x{a0}\x{a0}\x{a0}<
  1897. />\s(?a)\s(?-a)\s</utf,ucp
  1898. >\x{a0} \x{a0}<
  1899. \= Expect no match
  1900. >\x{a0}\x{a0}\x{a0}<
  1901. # WORDS
  1902. /\w+/i,utf
  1903. 123\x{660}abc
  1904. /\w+/i,utf,ucp
  1905. 123\x{660}abc
  1906. /\w+/i,utf,ucp,ascii_bsw
  1907. 123\x{660}abc
  1908. /[\w]+/i,utf
  1909. 123\x{660}abc
  1910. /[\w]+/i,utf,ucp
  1911. 123\x{660}abc
  1912. /[\w]+/i,utf,ucp,ascii_bsw
  1913. 123\x{660}abc
  1914. /\w(?aW)\w(?-aW)\w/utf,ucp
  1915. \x{660}A\x{c0}
  1916. \= Expect no match
  1917. \x{660}\x{c0}\x{c0}
  1918. /\w(?a)\w(?-a)\w/utf,ucp
  1919. \x{660}A\x{c0}
  1920. \= Expect no match
  1921. \x{660}\x{c0}\x{c0}
  1922. # POSIX
  1923. /^[[:digit:]]+$/utf,ucp
  1924. 123456
  1925. 123\x{660}456
  1926. /^[[:digit:]]+$/utf,ucp,ascii_digit
  1927. 123456
  1928. \= Expect no match
  1929. 123\x{660}456
  1930. /[[:digit:]]+/g,utf,ucp,ascii_digit
  1931. 123\x{660}456
  1932. /(?-aT)[[:digit:]](?aT)[[:digit:]]/utf,ucp,ascii_digit
  1933. 11
  1934. \x{ff11}1
  1935. \= Expect no match
  1936. 1\x{ff11}
  1937. /(?-aT:[[:digit:]])[[:digit:]]/utf,ucp,ascii_digit
  1938. 11
  1939. \x{ff11}1
  1940. \= Expect no match
  1941. 1\x{ff11}
  1942. /(?-aT:[[:digit:]])[[:digit:]]/utf,never_ucp,ascii_digit
  1943. 11
  1944. \= Expect no match
  1945. \x{ff11}1
  1946. 1\x{ff11}
  1947. /[[:digit:]]+/utf,ucp,ascii_posix
  1948. 123\x{660}456
  1949. /(?-aP)[[:digit:]](?aP)[[:digit:]]/utf,ucp,ascii_posix
  1950. 11
  1951. \x{ff11}1
  1952. \= Expect no match
  1953. 1\x{ff11}
  1954. /(?-aP:[[:digit:]])[[:digit:]]/utf,ucp,ascii_posix
  1955. 11
  1956. \x{ff11}1
  1957. \= Expect no match
  1958. 1\x{ff11}
  1959. /(?-a:[[:digit:]])[[:digit:]]/a,utf,ucp
  1960. 11
  1961. \x{ff11}1
  1962. \= Expect no match
  1963. 1\x{ff11}
  1964. />[[:space:]]+</utf,ucp
  1965. >\x{a0} \x{a0}<
  1966. >\x{a0}\x{a0}\x{a0}<
  1967. />[[:space:]]+</utf,ucp,ascii_posix
  1968. \= Expect no match
  1969. >\x{a0} \x{a0}<
  1970. /(?aP)[[:alnum:]]+/i,ucp,utf
  1971. abcáxyz
  1972. abc\x{660}xyz
  1973. /(?aP)[[:alnum:]\d]+/i,ucp,utf
  1974. abc\x{660}xyz
  1975. /(*UCP)(*UTF)[[:alnum:]](?aP:[[:alnum:]])[[:alnum:]]/
  1976. \x{660}A\x{660}
  1977. \= Expect no match
  1978. \x{660}\x{660}\x{660}
  1979. # VARIOUS
  1980. /[\d\s\w]+/a,ucp,utf
  1981. 9 A\x{660}À
  1982. 9 AÀ\x{660}
  1983. # End PCRE2_EXTRA_ASCII_xxx tests
  1984. /\w+/utf,ucp
  1985. --cafe\x{300}_au\x{203f}lait!
  1986. /[\w]+/utf,ucp
  1987. --cafe\x{300}_au\x{203f}lait!
  1988. /\b.+?\b/utf,ucp
  1989. --cafe\x{300}_au\x{203f}lait!
  1990. /caf\B.+?\B/utf,ucp
  1991. --cafe\x{300}_au\x{203f}lait!
  1992. # End of testinput7