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.

18070 lines
371 KiB

  1. # This set of tests is not Perl-compatible. It checks on special features
  2. # of PCRE2's API, error diagnostics, and the compiled code of some patterns.
  3. # It also checks the non-Perl syntax that PCRE2 supports (Python, .NET,
  4. # Oniguruma). There are also some tests where PCRE2 and Perl differ,
  5. # either because PCRE2 can't be compatible, or there is a possible Perl
  6. # bug.
  7. # NOTE: This is a non-UTF set of tests. When UTF support is needed, use
  8. # test 5.
  9. #forbid_utf
  10. #newline_default lf any anycrlf
  11. # Test binary zeroes in the pattern
  12. # /a\0B/ where 0 is a binary zero
  13. /61 5c 00 62/B,hex
  14. ------------------------------------------------------------------
  15. Bra
  16. a\x00b
  17. Ket
  18. End
  19. ------------------------------------------------------------------
  20. a\x{0}b
  21. 0: a\x00b
  22. # /a0b/ where 0 is a binary zero
  23. /61 00 62/B,hex
  24. ------------------------------------------------------------------
  25. Bra
  26. a\x00b
  27. Ket
  28. End
  29. ------------------------------------------------------------------
  30. a\x{0}b
  31. 0: a\x00b
  32. # /(?#B0C)DE/ where 0 is a binary zero
  33. /28 3f 23 42 00 43 29 44 45/B,hex
  34. ------------------------------------------------------------------
  35. Bra
  36. DE
  37. Ket
  38. End
  39. ------------------------------------------------------------------
  40. DE
  41. 0: DE
  42. /(a)b|/I
  43. Capture group count = 1
  44. May match empty string
  45. Subject length lower bound = 0
  46. /abc/I
  47. Capture group count = 0
  48. First code unit = 'a'
  49. Last code unit = 'c'
  50. Subject length lower bound = 3
  51. abc
  52. 0: abc
  53. defabc
  54. 0: abc
  55. abc\=anchored
  56. 0: abc
  57. \= Expect no match
  58. defabc\=anchored
  59. No match
  60. ABC
  61. No match
  62. /^abc/I
  63. Capture group count = 0
  64. Compile options: <none>
  65. Overall options: anchored
  66. First code unit = 'a'
  67. Subject length lower bound = 3
  68. abc
  69. 0: abc
  70. abc\=anchored
  71. 0: abc
  72. \= Expect no match
  73. defabc
  74. No match
  75. defabc\=anchored
  76. No match
  77. /a+bc/I
  78. Capture group count = 0
  79. First code unit = 'a'
  80. Last code unit = 'c'
  81. Subject length lower bound = 3
  82. /a*bc/I
  83. Capture group count = 0
  84. Starting code units: a b
  85. Last code unit = 'c'
  86. Subject length lower bound = 2
  87. /a{3}bc/I
  88. Capture group count = 0
  89. First code unit = 'a'
  90. Last code unit = 'c'
  91. Subject length lower bound = 5
  92. /(abc|a+z)/I
  93. Capture group count = 1
  94. First code unit = 'a'
  95. Subject length lower bound = 2
  96. /^abc$/I
  97. Capture group count = 0
  98. Compile options: <none>
  99. Overall options: anchored
  100. First code unit = 'a'
  101. Subject length lower bound = 3
  102. abc
  103. 0: abc
  104. \= Expect no match
  105. def\nabc
  106. No match
  107. /ab\idef/
  108. Failed: error 103 at offset 3: unrecognized character follows \
  109. /(?X)ab\idef/
  110. Failed: error 111 at offset 2: unrecognized character after (? or (?-
  111. /x{5,4}/
  112. Failed: error 104 at offset 5: numbers out of order in {} quantifier
  113. /z{65536}/
  114. Failed: error 105 at offset 7: number too big in {} quantifier
  115. /[abcd/
  116. Failed: error 106 at offset 5: missing terminating ] for character class
  117. /[\B]/B
  118. Failed: error 107 at offset 2: escape sequence is invalid in character class
  119. /[\R]/B
  120. Failed: error 107 at offset 2: escape sequence is invalid in character class
  121. /[\X]/B
  122. Failed: error 107 at offset 2: escape sequence is invalid in character class
  123. /[z-a]/
  124. Failed: error 108 at offset 3: range out of order in character class
  125. /^*/
  126. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  127. /(abc/
  128. Failed: error 114 at offset 4: missing closing parenthesis
  129. /(?# abc/
  130. Failed: error 118 at offset 7: missing ) after (?# comment
  131. /(?z)abc/
  132. Failed: error 111 at offset 2: unrecognized character after (? or (?-
  133. /.*b/I
  134. Capture group count = 0
  135. First code unit at start or follows newline
  136. Last code unit = 'b'
  137. Subject length lower bound = 1
  138. /.*?b/I
  139. Capture group count = 0
  140. First code unit at start or follows newline
  141. Last code unit = 'b'
  142. Subject length lower bound = 1
  143. /cat|dog|elephant/I
  144. Capture group count = 0
  145. Starting code units: c d e
  146. Subject length lower bound = 3
  147. this sentence eventually mentions a cat
  148. 0: cat
  149. this sentences rambles on and on for a while and then reaches elephant
  150. 0: elephant
  151. /cat|dog|elephant/I
  152. Capture group count = 0
  153. Starting code units: c d e
  154. Subject length lower bound = 3
  155. this sentence eventually mentions a cat
  156. 0: cat
  157. this sentences rambles on and on for a while and then reaches elephant
  158. 0: elephant
  159. /cat|dog|elephant/Ii
  160. Capture group count = 0
  161. Options: caseless
  162. Starting code units: C D E c d e
  163. Subject length lower bound = 3
  164. this sentence eventually mentions a CAT cat
  165. 0: CAT
  166. this sentences rambles on and on for a while to elephant ElePhant
  167. 0: elephant
  168. /a|[bcd]/I
  169. Capture group count = 0
  170. Starting code units: a b c d
  171. Subject length lower bound = 1
  172. /(a|[^\dZ])/I
  173. Capture group count = 1
  174. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  175. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  176. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
  177. ? @ 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 [ \ ] ^ _ ` a b c d
  178. e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83
  179. \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
  180. \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
  181. \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
  182. \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
  183. \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
  184. \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
  185. \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
  186. \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
  187. \xfc \xfd \xfe \xff
  188. Subject length lower bound = 1
  189. /(a|b)*[\s]/I
  190. Capture group count = 1
  191. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b
  192. Subject length lower bound = 1
  193. /(ab\2)/
  194. Failed: error 115 at offset 4: reference to non-existent subpattern
  195. /{4,5}abc/
  196. Failed: error 109 at offset 4: quantifier does not follow a repeatable item
  197. /(a)(b)(c)\2/I
  198. Capture group count = 3
  199. Max back reference = 2
  200. First code unit = 'a'
  201. Last code unit = 'c'
  202. Subject length lower bound = 4
  203. abcb
  204. 0: abcb
  205. 1: a
  206. 2: b
  207. 3: c
  208. abcb\=ovector=0
  209. 0: abcb
  210. 1: a
  211. 2: b
  212. 3: c
  213. abcb\=ovector=1
  214. Matched, but too many substrings
  215. 0: abcb
  216. abcb\=ovector=2
  217. Matched, but too many substrings
  218. 0: abcb
  219. 1: a
  220. abcb\=ovector=3
  221. Matched, but too many substrings
  222. 0: abcb
  223. 1: a
  224. 2: b
  225. abcb\=ovector=4
  226. 0: abcb
  227. 1: a
  228. 2: b
  229. 3: c
  230. /(a)bc|(a)(b)\2/I
  231. Capture group count = 3
  232. Max back reference = 2
  233. First code unit = 'a'
  234. Subject length lower bound = 3
  235. abc
  236. 0: abc
  237. 1: a
  238. abc\=ovector=0
  239. 0: abc
  240. 1: a
  241. abc\=ovector=1
  242. Matched, but too many substrings
  243. 0: abc
  244. abc\=ovector=2
  245. 0: abc
  246. 1: a
  247. aba
  248. 0: aba
  249. 1: <unset>
  250. 2: a
  251. 3: b
  252. aba\=ovector=0
  253. 0: aba
  254. 1: <unset>
  255. 2: a
  256. 3: b
  257. aba\=ovector=1
  258. Matched, but too many substrings
  259. 0: aba
  260. aba\=ovector=2
  261. Matched, but too many substrings
  262. 0: aba
  263. 1: <unset>
  264. aba\=ovector=3
  265. Matched, but too many substrings
  266. 0: aba
  267. 1: <unset>
  268. 2: a
  269. aba\=ovector=4
  270. 0: aba
  271. 1: <unset>
  272. 2: a
  273. 3: b
  274. /abc$/I,dollar_endonly
  275. Capture group count = 0
  276. Options: dollar_endonly
  277. First code unit = 'a'
  278. Last code unit = 'c'
  279. Subject length lower bound = 3
  280. abc
  281. 0: abc
  282. \= Expect no match
  283. abc\n
  284. No match
  285. abc\ndef
  286. No match
  287. /(a)(b)(c)(d)(e)\6/
  288. Failed: error 115 at offset 16: reference to non-existent subpattern
  289. /the quick brown fox/I
  290. Capture group count = 0
  291. First code unit = 't'
  292. Last code unit = 'x'
  293. Subject length lower bound = 19
  294. the quick brown fox
  295. 0: the quick brown fox
  296. this is a line with the quick brown fox
  297. 0: the quick brown fox
  298. /the quick brown fox/I,anchored
  299. Capture group count = 0
  300. Options: anchored
  301. First code unit = 't'
  302. Subject length lower bound = 19
  303. the quick brown fox
  304. 0: the quick brown fox
  305. \= Expect no match
  306. this is a line with the quick brown fox
  307. No match
  308. /ab(?z)cd/
  309. Failed: error 111 at offset 4: unrecognized character after (? or (?-
  310. /^abc|def/I
  311. Capture group count = 0
  312. Starting code units: a d
  313. Subject length lower bound = 3
  314. abcdef
  315. 0: abc
  316. abcdef\=notbol
  317. 0: def
  318. /.*((abc)$|(def))/I
  319. Capture group count = 3
  320. First code unit at start or follows newline
  321. Subject length lower bound = 3
  322. defabc
  323. 0: defabc
  324. 1: abc
  325. 2: abc
  326. defabc\=noteol
  327. 0: def
  328. 1: def
  329. 2: <unset>
  330. 3: def
  331. /)/
  332. Failed: error 122 at offset 0: unmatched closing parenthesis
  333. /a[]b/
  334. Failed: error 106 at offset 4: missing terminating ] for character class
  335. /[^aeiou ]{3,}/I
  336. Capture group count = 0
  337. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  338. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  339. \x1a \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6
  340. 7 8 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 [
  341. \ ] ^ _ ` b c d f g h j k l m n p q r s t v w x y z { | } ~ \x7f \x80 \x81
  342. \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90
  343. \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f
  344. \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
  345. \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
  346. \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
  347. \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
  348. \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
  349. \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
  350. \xfa \xfb \xfc \xfd \xfe \xff
  351. Subject length lower bound = 3
  352. co-processors, and for
  353. 0: -pr
  354. /<.*>/I
  355. Capture group count = 0
  356. First code unit = '<'
  357. Last code unit = '>'
  358. Subject length lower bound = 2
  359. abc<def>ghi<klm>nop
  360. 0: <def>ghi<klm>
  361. /<.*?>/I
  362. Capture group count = 0
  363. First code unit = '<'
  364. Last code unit = '>'
  365. Subject length lower bound = 2
  366. abc<def>ghi<klm>nop
  367. 0: <def>
  368. /<.*>/I,ungreedy
  369. Capture group count = 0
  370. Options: ungreedy
  371. First code unit = '<'
  372. Last code unit = '>'
  373. Subject length lower bound = 2
  374. abc<def>ghi<klm>nop
  375. 0: <def>
  376. /(?U)<.*>/I
  377. Capture group count = 0
  378. First code unit = '<'
  379. Last code unit = '>'
  380. Subject length lower bound = 2
  381. abc<def>ghi<klm>nop
  382. 0: <def>
  383. /<.*?>/I,ungreedy
  384. Capture group count = 0
  385. Options: ungreedy
  386. First code unit = '<'
  387. Last code unit = '>'
  388. Subject length lower bound = 2
  389. abc<def>ghi<klm>nop
  390. 0: <def>ghi<klm>
  391. /={3,}/I,ungreedy
  392. Capture group count = 0
  393. Options: ungreedy
  394. First code unit = '='
  395. Last code unit = '='
  396. Subject length lower bound = 3
  397. abc========def
  398. 0: ===
  399. /(?U)={3,}?/I
  400. Capture group count = 0
  401. First code unit = '='
  402. Last code unit = '='
  403. Subject length lower bound = 3
  404. abc========def
  405. 0: ========
  406. /(?<!bar|cattle)foo/I
  407. Capture group count = 0
  408. Max lookbehind = 6
  409. First code unit = 'f'
  410. Last code unit = 'o'
  411. Subject length lower bound = 3
  412. foo
  413. 0: foo
  414. catfoo
  415. 0: foo
  416. \= Expect no match
  417. the barfoo
  418. No match
  419. and cattlefoo
  420. No match
  421. /abc(?<=a+)b/
  422. Failed: error 125 at offset 3: length of lookbehind assertion is not limited
  423. /(?<!(foo)a\1)bar/
  424. /(?i)abc/I
  425. Capture group count = 0
  426. First code unit = 'a' (caseless)
  427. Last code unit = 'c' (caseless)
  428. Subject length lower bound = 3
  429. /(a|(?m)a)/I
  430. Capture group count = 1
  431. First code unit = 'a'
  432. Subject length lower bound = 1
  433. /(?i)^1234/I
  434. Capture group count = 0
  435. Compile options: <none>
  436. Overall options: anchored
  437. First code unit = '1'
  438. Subject length lower bound = 4
  439. /(^b|(?i)^d)/I
  440. Capture group count = 1
  441. Compile options: <none>
  442. Overall options: anchored
  443. Starting code units: D b d
  444. Subject length lower bound = 1
  445. /(?s).*/I
  446. Capture group count = 0
  447. May match empty string
  448. Compile options: <none>
  449. Overall options: anchored
  450. Subject length lower bound = 0
  451. /[abcd]/I
  452. Capture group count = 0
  453. Starting code units: a b c d
  454. Subject length lower bound = 1
  455. /(?i)[abcd]/I
  456. Capture group count = 0
  457. Starting code units: A B C D a b c d
  458. Subject length lower bound = 1
  459. /(?m)[xy]|(b|c)/I
  460. Capture group count = 1
  461. Starting code units: b c x y
  462. Subject length lower bound = 1
  463. /(^a|^b)/Im
  464. Capture group count = 1
  465. Options: multiline
  466. First code unit at start or follows newline
  467. Subject length lower bound = 1
  468. /(?i)(^a|^b)/Im
  469. Capture group count = 1
  470. Options: multiline
  471. First code unit at start or follows newline
  472. Subject length lower bound = 1
  473. /(a)(?(1)a|b|c)/
  474. Failed: error 127 at offset 3: conditional subpattern contains more than two branches
  475. /(?(?=a)a|b|c)/
  476. Failed: error 127 at offset 0: conditional subpattern contains more than two branches
  477. /(?(1a)/
  478. Failed: error 124 at offset 4: missing closing parenthesis for condition
  479. /(?(1a))/
  480. Failed: error 124 at offset 4: missing closing parenthesis for condition
  481. /(?(?i))/
  482. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  483. /(?(abc))/
  484. Failed: error 115 at offset 3: reference to non-existent subpattern
  485. /(?(?<ab))/
  486. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  487. /((?s)blah)\s+\1/I
  488. Capture group count = 1
  489. Max back reference = 1
  490. First code unit = 'b'
  491. Last code unit = 'h'
  492. Subject length lower bound = 9
  493. /((?i)blah)\s+\1/I
  494. Capture group count = 1
  495. Max back reference = 1
  496. First code unit = 'b' (caseless)
  497. Last code unit = 'h' (caseless)
  498. Subject length lower bound = 9
  499. /((?i)b)/IB
  500. ------------------------------------------------------------------
  501. Bra
  502. CBra 1
  503. /i b
  504. Ket
  505. Ket
  506. End
  507. ------------------------------------------------------------------
  508. Capture group count = 1
  509. First code unit = 'b' (caseless)
  510. Subject length lower bound = 1
  511. /(a*b|(?i:c*(?-i)d))/I
  512. Capture group count = 1
  513. Starting code units: C a b c d
  514. Subject length lower bound = 1
  515. /a$/I
  516. Capture group count = 0
  517. First code unit = 'a'
  518. Subject length lower bound = 1
  519. a
  520. 0: a
  521. a\n
  522. 0: a
  523. \= Expect no match
  524. a\=noteol
  525. No match
  526. a\n\=noteol
  527. No match
  528. /a$/Im
  529. Capture group count = 0
  530. Options: multiline
  531. First code unit = 'a'
  532. Subject length lower bound = 1
  533. a
  534. 0: a
  535. a\n
  536. 0: a
  537. a\n\=noteol
  538. 0: a
  539. \= Expect no match
  540. a\=noteol
  541. No match
  542. /\Aabc/Im
  543. Capture group count = 0
  544. Max lookbehind = 1
  545. Compile options: multiline
  546. Overall options: anchored multiline
  547. First code unit = 'a'
  548. Subject length lower bound = 3
  549. /^abc/Im
  550. Capture group count = 0
  551. Options: multiline
  552. First code unit at start or follows newline
  553. Last code unit = 'c'
  554. Subject length lower bound = 3
  555. /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
  556. Capture group count = 5
  557. Compile options: <none>
  558. Overall options: anchored
  559. First code unit = 'a'
  560. Subject length lower bound = 3
  561. aaaaabbbbbcccccdef
  562. 0: aaaaabbbbbcccccdef
  563. 1: aaaaabbbbbcccccdef
  564. 2: aaaaa
  565. 3: b
  566. 4: bbbbccccc
  567. 5: def
  568. /(?<=foo)[ab]/I
  569. Capture group count = 0
  570. Max lookbehind = 3
  571. Starting code units: a b
  572. Subject length lower bound = 1
  573. /(?<!foo)(alpha|omega)/I
  574. Capture group count = 1
  575. Max lookbehind = 3
  576. Starting code units: a o
  577. Last code unit = 'a'
  578. Subject length lower bound = 5
  579. /(?!alphabet)[ab]/I
  580. Capture group count = 0
  581. Starting code units: a b
  582. Subject length lower bound = 1
  583. /(?<=foo\n)^bar/Im
  584. Capture group count = 0
  585. Max lookbehind = 4
  586. Contains explicit CR or LF match
  587. Options: multiline
  588. Last code unit = 'r'
  589. Subject length lower bound = 3
  590. foo\nbarbar
  591. 0: bar
  592. \= Expect no match
  593. rhubarb
  594. No match
  595. barbell
  596. No match
  597. abc\nbarton
  598. No match
  599. /^(?<=foo\n)bar/Im
  600. Capture group count = 0
  601. Max lookbehind = 4
  602. Contains explicit CR or LF match
  603. Options: multiline
  604. First code unit at start or follows newline
  605. Last code unit = 'r'
  606. Subject length lower bound = 3
  607. foo\nbarbar
  608. 0: bar
  609. \= Expect no match
  610. rhubarb
  611. No match
  612. barbell
  613. No match
  614. abc\nbarton
  615. No match
  616. /(?>^abc)/Im
  617. Capture group count = 0
  618. Options: multiline
  619. First code unit at start or follows newline
  620. Last code unit = 'c'
  621. Subject length lower bound = 3
  622. abc
  623. 0: abc
  624. def\nabc
  625. 0: abc
  626. \= Expect no match
  627. defabc
  628. No match
  629. /(?<=ab(c+)d)ef/
  630. Failed: error 125 at offset 0: length of lookbehind assertion is not limited
  631. /(?<=ab(?<=c+)d)ef/
  632. Failed: error 125 at offset 6: length of lookbehind assertion is not limited
  633. /The next three are in testinput2 because they have variable length branches/
  634. /(?<=bullock|donkey)-cart/I
  635. Capture group count = 0
  636. Max lookbehind = 7
  637. First code unit = '-'
  638. Last code unit = 't'
  639. Subject length lower bound = 5
  640. the bullock-cart
  641. 0: -cart
  642. a donkey-cart race
  643. 0: -cart
  644. \= Expect no match
  645. cart
  646. No match
  647. horse-and-cart
  648. No match
  649. /(?<=ab(?i)x|y|z)/I
  650. Capture group count = 0
  651. Max lookbehind = 3
  652. May match empty string
  653. Subject length lower bound = 0
  654. /(?>.*)(?<=(abcd)|(xyz))/I
  655. Capture group count = 2
  656. Max lookbehind = 4
  657. May match empty string
  658. Subject length lower bound = 0
  659. alphabetabcd
  660. 0: alphabetabcd
  661. 1: abcd
  662. endingxyz
  663. 0: endingxyz
  664. 1: <unset>
  665. 2: xyz
  666. /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
  667. Capture group count = 0
  668. Max lookbehind = 4
  669. First code unit = 'Z'
  670. Last code unit = 'Z'
  671. Subject length lower bound = 2
  672. abxyZZ
  673. 0: ZZ
  674. abXyZZ
  675. 0: ZZ
  676. ZZZ
  677. 0: ZZ
  678. zZZ
  679. 0: ZZ
  680. bZZ
  681. 0: ZZ
  682. BZZ
  683. 0: ZZ
  684. \= Expect no match
  685. ZZ
  686. No match
  687. abXYZZ
  688. No match
  689. zzz
  690. No match
  691. bzz
  692. No match
  693. /(?<!(foo)a)bar/I
  694. Capture group count = 1
  695. Max lookbehind = 4
  696. First code unit = 'b'
  697. Last code unit = 'r'
  698. Subject length lower bound = 3
  699. bar
  700. 0: bar
  701. foobbar
  702. 0: bar
  703. \= Expect no match
  704. fooabar
  705. No match
  706. # Perl does not fail these two for the final subjects.
  707. /^(xa|=?\1a){2}$/
  708. xa=xaa
  709. 0: xa=xaa
  710. 1: =xaa
  711. \= Expect no match
  712. xa=xaaa
  713. No match
  714. /^(xa|=?\1a)+$/
  715. xa=xaa
  716. 0: xa=xaa
  717. 1: =xaa
  718. \= Expect no match
  719. xa=xaaa
  720. No match
  721. # These are syntax tests from Perl 5.005
  722. /a[b-a]/
  723. Failed: error 108 at offset 4: range out of order in character class
  724. /a[]b/
  725. Failed: error 106 at offset 4: missing terminating ] for character class
  726. /a[/
  727. Failed: error 106 at offset 2: missing terminating ] for character class
  728. /*a/
  729. Failed: error 109 at offset 0: quantifier does not follow a repeatable item
  730. /(*)b/
  731. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  732. /abc)/
  733. Failed: error 122 at offset 3: unmatched closing parenthesis
  734. /(abc/
  735. Failed: error 114 at offset 4: missing closing parenthesis
  736. /a**/
  737. Failed: error 109 at offset 2: quantifier does not follow a repeatable item
  738. /)(/
  739. Failed: error 122 at offset 0: unmatched closing parenthesis
  740. /\1/
  741. Failed: error 115 at offset 1: reference to non-existent subpattern
  742. /\2/
  743. Failed: error 115 at offset 1: reference to non-existent subpattern
  744. /(a)|\2/
  745. Failed: error 115 at offset 5: reference to non-existent subpattern
  746. /a[b-a]/Ii
  747. Failed: error 108 at offset 4: range out of order in character class
  748. /a[]b/Ii
  749. Failed: error 106 at offset 4: missing terminating ] for character class
  750. /a[/Ii
  751. Failed: error 106 at offset 2: missing terminating ] for character class
  752. /*a/Ii
  753. Failed: error 109 at offset 0: quantifier does not follow a repeatable item
  754. /(*)b/Ii
  755. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  756. /abc)/Ii
  757. Failed: error 122 at offset 3: unmatched closing parenthesis
  758. /(abc/Ii
  759. Failed: error 114 at offset 4: missing closing parenthesis
  760. /a**/Ii
  761. Failed: error 109 at offset 2: quantifier does not follow a repeatable item
  762. /)(/Ii
  763. Failed: error 122 at offset 0: unmatched closing parenthesis
  764. /:(?:/
  765. Failed: error 114 at offset 4: missing closing parenthesis
  766. /(?<%)b/
  767. Failed: error 162 at offset 3: subpattern name expected
  768. /a(?{)b/
  769. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  770. /a(?{{})b/
  771. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  772. /a(?{}})b/
  773. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  774. /a(?{"{"})b/
  775. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  776. /a(?{"{"}})b/
  777. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  778. /(?(1?)a|b)/
  779. Failed: error 124 at offset 4: missing closing parenthesis for condition
  780. /[a[:xyz:/
  781. Failed: error 106 at offset 8: missing terminating ] for character class
  782. /(?<=x+)y/
  783. Failed: error 125 at offset 0: length of lookbehind assertion is not limited
  784. /a{37,17}/
  785. Failed: error 104 at offset 7: numbers out of order in {} quantifier
  786. /abc/\
  787. Failed: error 101 at offset 4: \ at end of pattern
  788. /abc/\i
  789. Failed: error 101 at offset 4: \ at end of pattern
  790. /(a)bc(d)/I
  791. Capture group count = 2
  792. First code unit = 'a'
  793. Last code unit = 'd'
  794. Subject length lower bound = 4
  795. abcd
  796. 0: abcd
  797. 1: a
  798. 2: d
  799. abcd\=copy=2
  800. 0: abcd
  801. 1: a
  802. 2: d
  803. 2C d (1)
  804. abcd\=copy=5
  805. 0: abcd
  806. 1: a
  807. 2: d
  808. Copy substring 5 failed (-49): unknown substring
  809. /(.{20})/I
  810. Capture group count = 1
  811. Subject length lower bound = 20
  812. abcdefghijklmnopqrstuvwxyz
  813. 0: abcdefghijklmnopqrst
  814. 1: abcdefghijklmnopqrst
  815. abcdefghijklmnopqrstuvwxyz\=copy=1
  816. 0: abcdefghijklmnopqrst
  817. 1: abcdefghijklmnopqrst
  818. 1C abcdefghijklmnopqrst (20)
  819. abcdefghijklmnopqrstuvwxyz\=get=1
  820. 0: abcdefghijklmnopqrst
  821. 1: abcdefghijklmnopqrst
  822. 1G abcdefghijklmnopqrst (20)
  823. /(.{15})/I
  824. Capture group count = 1
  825. Subject length lower bound = 15
  826. abcdefghijklmnopqrstuvwxyz
  827. 0: abcdefghijklmno
  828. 1: abcdefghijklmno
  829. abcdefghijklmnopqrstuvwxyz\=copy=1,get=1
  830. 0: abcdefghijklmno
  831. 1: abcdefghijklmno
  832. 1C abcdefghijklmno (15)
  833. 1G abcdefghijklmno (15)
  834. /(.{16})/I
  835. Capture group count = 1
  836. Subject length lower bound = 16
  837. abcdefghijklmnopqrstuvwxyz
  838. 0: abcdefghijklmnop
  839. 1: abcdefghijklmnop
  840. abcdefghijklmnopqrstuvwxyz\=copy=1,get=1,getall
  841. 0: abcdefghijklmnop
  842. 1: abcdefghijklmnop
  843. 1C abcdefghijklmnop (16)
  844. 1G abcdefghijklmnop (16)
  845. 0L abcdefghijklmnop
  846. 1L abcdefghijklmnop
  847. /^(a|(bc))de(f)/I
  848. Capture group count = 3
  849. Compile options: <none>
  850. Overall options: anchored
  851. Starting code units: a b
  852. Subject length lower bound = 4
  853. adef\=get=1,get=2,get=3,get=4,getall
  854. 0: adef
  855. 1: a
  856. 2: <unset>
  857. 3: f
  858. 1G a (1)
  859. Get substring 2 failed (-55): requested value is not set
  860. 3G f (1)
  861. Get substring 4 failed (-49): unknown substring
  862. 0L adef
  863. 1L a
  864. 2L
  865. 3L f
  866. bcdef\=get=1,get=2,get=3,get=4,getall
  867. 0: bcdef
  868. 1: bc
  869. 2: bc
  870. 3: f
  871. 1G bc (2)
  872. 2G bc (2)
  873. 3G f (1)
  874. Get substring 4 failed (-49): unknown substring
  875. 0L bcdef
  876. 1L bc
  877. 2L bc
  878. 3L f
  879. adefghijk\=copy=0
  880. 0: adef
  881. 1: a
  882. 2: <unset>
  883. 3: f
  884. 0C adef (4)
  885. /^abc\00def/I
  886. Capture group count = 0
  887. Compile options: <none>
  888. Overall options: anchored
  889. First code unit = 'a'
  890. Subject length lower bound = 7
  891. abc\00def\=copy=0,getall
  892. 0: abc\x00def
  893. 0C abc\x00def (7)
  894. 0L abc\x00def
  895. /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
  896. )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
  897. )?)?)?)?)?)?)?)?)?otherword/I
  898. Capture group count = 8
  899. Contains explicit CR or LF match
  900. First code unit = 'w'
  901. Last code unit = 'd'
  902. Subject length lower bound = 14
  903. /.*X/IB
  904. ------------------------------------------------------------------
  905. Bra
  906. Any*
  907. X
  908. Ket
  909. End
  910. ------------------------------------------------------------------
  911. Capture group count = 0
  912. First code unit at start or follows newline
  913. Last code unit = 'X'
  914. Subject length lower bound = 1
  915. /.*X/IBs
  916. ------------------------------------------------------------------
  917. Bra
  918. AllAny*
  919. X
  920. Ket
  921. End
  922. ------------------------------------------------------------------
  923. Capture group count = 0
  924. Compile options: dotall
  925. Overall options: anchored dotall
  926. Last code unit = 'X'
  927. Subject length lower bound = 1
  928. /(.*X|^B)/IB
  929. ------------------------------------------------------------------
  930. Bra
  931. CBra 1
  932. Any*
  933. X
  934. Alt
  935. ^
  936. B
  937. Ket
  938. Ket
  939. End
  940. ------------------------------------------------------------------
  941. Capture group count = 1
  942. First code unit at start or follows newline
  943. Subject length lower bound = 1
  944. /(.*X|^B)/IBs
  945. ------------------------------------------------------------------
  946. Bra
  947. CBra 1
  948. AllAny*
  949. X
  950. Alt
  951. ^
  952. B
  953. Ket
  954. Ket
  955. End
  956. ------------------------------------------------------------------
  957. Capture group count = 1
  958. Compile options: dotall
  959. Overall options: anchored dotall
  960. Subject length lower bound = 1
  961. /(?s)(.*X|^B)/IB
  962. ------------------------------------------------------------------
  963. Bra
  964. CBra 1
  965. AllAny*
  966. X
  967. Alt
  968. ^
  969. B
  970. Ket
  971. Ket
  972. End
  973. ------------------------------------------------------------------
  974. Capture group count = 1
  975. Compile options: <none>
  976. Overall options: anchored
  977. Subject length lower bound = 1
  978. /(?s:.*X|^B)/IB
  979. ------------------------------------------------------------------
  980. Bra
  981. Bra
  982. AllAny*
  983. X
  984. Alt
  985. ^
  986. B
  987. Ket
  988. Ket
  989. End
  990. ------------------------------------------------------------------
  991. Capture group count = 0
  992. Compile options: <none>
  993. Overall options: anchored
  994. Subject length lower bound = 1
  995. /\Biss\B/I,aftertext
  996. Capture group count = 0
  997. Max lookbehind = 1
  998. First code unit = 'i'
  999. Last code unit = 's'
  1000. Subject length lower bound = 3
  1001. Mississippi
  1002. 0: iss
  1003. 0+ issippi
  1004. /iss/I,aftertext,altglobal
  1005. Capture group count = 0
  1006. First code unit = 'i'
  1007. Last code unit = 's'
  1008. Subject length lower bound = 3
  1009. Mississippi
  1010. 0: iss
  1011. 0+ issippi
  1012. 0: iss
  1013. 0+ ippi
  1014. /\Biss\B/I,aftertext,altglobal
  1015. Capture group count = 0
  1016. Max lookbehind = 1
  1017. First code unit = 'i'
  1018. Last code unit = 's'
  1019. Subject length lower bound = 3
  1020. Mississippi
  1021. 0: iss
  1022. 0+ issippi
  1023. /\Biss\B/Ig,aftertext
  1024. Capture group count = 0
  1025. Max lookbehind = 1
  1026. First code unit = 'i'
  1027. Last code unit = 's'
  1028. Subject length lower bound = 3
  1029. Mississippi
  1030. 0: iss
  1031. 0+ issippi
  1032. 0: iss
  1033. 0+ ippi
  1034. \= Expect no match
  1035. Mississippi\=anchored
  1036. No match
  1037. /(?<=[Ms])iss/Ig,aftertext
  1038. Capture group count = 0
  1039. Max lookbehind = 1
  1040. First code unit = 'i'
  1041. Last code unit = 's'
  1042. Subject length lower bound = 3
  1043. Mississippi
  1044. 0: iss
  1045. 0+ issippi
  1046. 0: iss
  1047. 0+ ippi
  1048. /(?<=[Ms])iss/I,aftertext,altglobal
  1049. Capture group count = 0
  1050. Max lookbehind = 1
  1051. First code unit = 'i'
  1052. Last code unit = 's'
  1053. Subject length lower bound = 3
  1054. Mississippi
  1055. 0: iss
  1056. 0+ issippi
  1057. /^iss/Ig,aftertext
  1058. Capture group count = 0
  1059. Compile options: <none>
  1060. Overall options: anchored
  1061. First code unit = 'i'
  1062. Subject length lower bound = 3
  1063. ississippi
  1064. 0: iss
  1065. 0+ issippi
  1066. /.*iss/Ig,aftertext
  1067. Capture group count = 0
  1068. First code unit at start or follows newline
  1069. Last code unit = 's'
  1070. Subject length lower bound = 3
  1071. abciss\nxyzisspqr
  1072. 0: abciss
  1073. 0+ \x0axyzisspqr
  1074. 0: xyziss
  1075. 0+ pqr
  1076. /.i./Ig,aftertext
  1077. Capture group count = 0
  1078. Last code unit = 'i'
  1079. Subject length lower bound = 3
  1080. Mississippi
  1081. 0: Mis
  1082. 0+ sissippi
  1083. 0: sis
  1084. 0+ sippi
  1085. 0: sip
  1086. 0+ pi
  1087. Mississippi\=anchored
  1088. 0: Mis
  1089. 0+ sissippi
  1090. 0: sis
  1091. 0+ sippi
  1092. 0: sip
  1093. 0+ pi
  1094. Missouri river
  1095. 0: Mis
  1096. 0+ souri river
  1097. 0: ri
  1098. 0+ river
  1099. 0: riv
  1100. 0+ er
  1101. Missouri river\=anchored
  1102. 0: Mis
  1103. 0+ souri river
  1104. /^.is/Ig,aftertext
  1105. Capture group count = 0
  1106. Compile options: <none>
  1107. Overall options: anchored
  1108. Subject length lower bound = 3
  1109. Mississippi
  1110. 0: Mis
  1111. 0+ sissippi
  1112. /^ab\n/Ig,aftertext
  1113. Capture group count = 0
  1114. Contains explicit CR or LF match
  1115. Compile options: <none>
  1116. Overall options: anchored
  1117. First code unit = 'a'
  1118. Subject length lower bound = 3
  1119. ab\nab\ncd
  1120. 0: ab\x0a
  1121. 0+ ab\x0acd
  1122. /^ab\n/Igm,aftertext
  1123. Capture group count = 0
  1124. Contains explicit CR or LF match
  1125. Options: multiline
  1126. First code unit at start or follows newline
  1127. Last code unit = \x0a
  1128. Subject length lower bound = 3
  1129. ab\nab\ncd
  1130. 0: ab\x0a
  1131. 0+ ab\x0acd
  1132. 0: ab\x0a
  1133. 0+ cd
  1134. /^/gm,newline=any
  1135. a\rb\nc\r\nxyz\=aftertext
  1136. 0:
  1137. 0+ a\x0db\x0ac\x0d\x0axyz
  1138. 0:
  1139. 0+ b\x0ac\x0d\x0axyz
  1140. 0:
  1141. 0+ c\x0d\x0axyz
  1142. 0:
  1143. 0+ xyz
  1144. /abc/I
  1145. Capture group count = 0
  1146. First code unit = 'a'
  1147. Last code unit = 'c'
  1148. Subject length lower bound = 3
  1149. /abc|bac/I
  1150. Capture group count = 0
  1151. Starting code units: a b
  1152. Last code unit = 'c'
  1153. Subject length lower bound = 3
  1154. /(abc|bac)/I
  1155. Capture group count = 1
  1156. Starting code units: a b
  1157. Last code unit = 'c'
  1158. Subject length lower bound = 3
  1159. /(abc|(c|dc))/I
  1160. Capture group count = 2
  1161. Starting code units: a c d
  1162. Last code unit = 'c'
  1163. Subject length lower bound = 1
  1164. /(abc|(d|de)c)/I
  1165. Capture group count = 2
  1166. Starting code units: a d
  1167. Last code unit = 'c'
  1168. Subject length lower bound = 2
  1169. /a*/I
  1170. Capture group count = 0
  1171. May match empty string
  1172. Subject length lower bound = 0
  1173. /a+/I
  1174. Capture group count = 0
  1175. First code unit = 'a'
  1176. Subject length lower bound = 1
  1177. /(baa|a+)/I
  1178. Capture group count = 1
  1179. Starting code units: a b
  1180. Last code unit = 'a'
  1181. Subject length lower bound = 1
  1182. /a{0,3}/I
  1183. Capture group count = 0
  1184. May match empty string
  1185. Subject length lower bound = 0
  1186. /baa{3,}/I
  1187. Capture group count = 0
  1188. First code unit = 'b'
  1189. Last code unit = 'a'
  1190. Subject length lower bound = 5
  1191. /"([^\\"]+|\\.)*"/I
  1192. Capture group count = 1
  1193. First code unit = '"'
  1194. Last code unit = '"'
  1195. Subject length lower bound = 2
  1196. /(abc|ab[cd])/I
  1197. Capture group count = 1
  1198. First code unit = 'a'
  1199. Subject length lower bound = 3
  1200. /(a|.)/I
  1201. Capture group count = 1
  1202. Subject length lower bound = 1
  1203. /a|ba|\w/I
  1204. Capture group count = 0
  1205. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1206. Q R S T U V W X Y Z _ 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
  1207. Subject length lower bound = 1
  1208. /abc(?=pqr)/I
  1209. Capture group count = 0
  1210. First code unit = 'a'
  1211. Last code unit = 'r'
  1212. Subject length lower bound = 3
  1213. /...(?<=abc)/I
  1214. Capture group count = 0
  1215. Max lookbehind = 3
  1216. Subject length lower bound = 3
  1217. /abc(?!pqr)/I
  1218. Capture group count = 0
  1219. First code unit = 'a'
  1220. Last code unit = 'c'
  1221. Subject length lower bound = 3
  1222. /ab./I
  1223. Capture group count = 0
  1224. First code unit = 'a'
  1225. Last code unit = 'b'
  1226. Subject length lower bound = 3
  1227. /ab[xyz]/I
  1228. Capture group count = 0
  1229. First code unit = 'a'
  1230. Last code unit = 'b'
  1231. Subject length lower bound = 3
  1232. /abc*/I
  1233. Capture group count = 0
  1234. First code unit = 'a'
  1235. Last code unit = 'b'
  1236. Subject length lower bound = 2
  1237. /ab.c*/I
  1238. Capture group count = 0
  1239. First code unit = 'a'
  1240. Last code unit = 'b'
  1241. Subject length lower bound = 3
  1242. /a.c*/I
  1243. Capture group count = 0
  1244. First code unit = 'a'
  1245. Subject length lower bound = 2
  1246. /.c*/I
  1247. Capture group count = 0
  1248. Subject length lower bound = 1
  1249. /ac*/I
  1250. Capture group count = 0
  1251. First code unit = 'a'
  1252. Subject length lower bound = 1
  1253. /(a.c*|b.c*)/I
  1254. Capture group count = 1
  1255. Starting code units: a b
  1256. Subject length lower bound = 2
  1257. /a.c*|aba/I
  1258. Capture group count = 0
  1259. First code unit = 'a'
  1260. Subject length lower bound = 2
  1261. /.+a/I
  1262. Capture group count = 0
  1263. Last code unit = 'a'
  1264. Subject length lower bound = 2
  1265. /(?=abcda)a.*/I
  1266. Capture group count = 0
  1267. First code unit = 'a'
  1268. Last code unit = 'a'
  1269. Subject length lower bound = 2
  1270. /(?=a)a.*/I
  1271. Capture group count = 0
  1272. First code unit = 'a'
  1273. Subject length lower bound = 1
  1274. /a(b)*/I
  1275. Capture group count = 1
  1276. First code unit = 'a'
  1277. Subject length lower bound = 1
  1278. /a\d*/I
  1279. Capture group count = 0
  1280. First code unit = 'a'
  1281. Subject length lower bound = 1
  1282. /ab\d*/I
  1283. Capture group count = 0
  1284. First code unit = 'a'
  1285. Last code unit = 'b'
  1286. Subject length lower bound = 2
  1287. /a(\d)*/I
  1288. Capture group count = 1
  1289. First code unit = 'a'
  1290. Subject length lower bound = 1
  1291. /abcde{0,0}/I
  1292. Capture group count = 0
  1293. First code unit = 'a'
  1294. Last code unit = 'd'
  1295. Subject length lower bound = 4
  1296. /ab\d+/I
  1297. Capture group count = 0
  1298. First code unit = 'a'
  1299. Last code unit = 'b'
  1300. Subject length lower bound = 3
  1301. /a(?(1)b)(.)/I
  1302. Capture group count = 1
  1303. Max back reference = 1
  1304. First code unit = 'a'
  1305. Subject length lower bound = 2
  1306. /a(?(1)bag|big)(.)/I
  1307. Capture group count = 1
  1308. Max back reference = 1
  1309. First code unit = 'a'
  1310. Last code unit = 'g'
  1311. Subject length lower bound = 5
  1312. /a(?(1)bag|big)*(.)/I
  1313. Capture group count = 1
  1314. Max back reference = 1
  1315. First code unit = 'a'
  1316. Subject length lower bound = 2
  1317. /a(?(1)bag|big)+(.)/I
  1318. Capture group count = 1
  1319. Max back reference = 1
  1320. First code unit = 'a'
  1321. Last code unit = 'g'
  1322. Subject length lower bound = 5
  1323. /a(?(1)b..|b..)(.)/I
  1324. Capture group count = 1
  1325. Max back reference = 1
  1326. First code unit = 'a'
  1327. Last code unit = 'b'
  1328. Subject length lower bound = 5
  1329. /ab\d{0}e/I
  1330. Capture group count = 0
  1331. First code unit = 'a'
  1332. Last code unit = 'e'
  1333. Subject length lower bound = 3
  1334. /a?b?/I
  1335. Capture group count = 0
  1336. May match empty string
  1337. Subject length lower bound = 0
  1338. a
  1339. 0: a
  1340. b
  1341. 0: b
  1342. ab
  1343. 0: ab
  1344. \
  1345. 0:
  1346. \= Expect no match
  1347. \=notempty
  1348. No match
  1349. /|-/I
  1350. Capture group count = 0
  1351. May match empty string
  1352. Subject length lower bound = 0
  1353. abcd
  1354. 0:
  1355. -abc
  1356. 0:
  1357. ab-c\=notempty
  1358. 0: -
  1359. \= Expect no match
  1360. abc\=notempty
  1361. No match
  1362. /^.?abcd/I
  1363. Capture group count = 0
  1364. Compile options: <none>
  1365. Overall options: anchored
  1366. Last code unit = 'd'
  1367. Subject length lower bound = 4
  1368. /\( # ( at start
  1369. (?: # Non-capturing bracket
  1370. (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
  1371. | # Or
  1372. (?R) # Recurse - i.e. nested bracketed string
  1373. )* # Zero or more contents
  1374. \) # Closing )
  1375. /Ix
  1376. Capture group count = 0
  1377. Options: extended
  1378. First code unit = '('
  1379. Last code unit = ')'
  1380. Subject length lower bound = 2
  1381. (abcd)
  1382. 0: (abcd)
  1383. (abcd)xyz
  1384. 0: (abcd)
  1385. xyz(abcd)
  1386. 0: (abcd)
  1387. (ab(xy)cd)pqr
  1388. 0: (ab(xy)cd)
  1389. (ab(xycd)pqr
  1390. 0: (xycd)
  1391. () abc ()
  1392. 0: ()
  1393. 12(abcde(fsh)xyz(foo(bar))lmno)89
  1394. 0: (abcde(fsh)xyz(foo(bar))lmno)
  1395. \= Expect no match
  1396. abcd
  1397. No match
  1398. abcd)
  1399. No match
  1400. (abcd
  1401. No match
  1402. /\( ( (?>[^()]+) | (?R) )* \) /Igx
  1403. Capture group count = 1
  1404. Options: extended
  1405. First code unit = '('
  1406. Last code unit = ')'
  1407. Subject length lower bound = 2
  1408. (ab(xy)cd)pqr
  1409. 0: (ab(xy)cd)
  1410. 1: cd
  1411. 1(abcd)(x(y)z)pqr
  1412. 0: (abcd)
  1413. 1: abcd
  1414. 0: (x(y)z)
  1415. 1: z
  1416. /\( (?: (?>[^()]+) | (?R) ) \) /Ix
  1417. Capture group count = 0
  1418. Options: extended
  1419. First code unit = '('
  1420. Last code unit = ')'
  1421. Subject length lower bound = 3
  1422. (abcd)
  1423. 0: (abcd)
  1424. (ab(xy)cd)
  1425. 0: (xy)
  1426. (a(b(c)d)e)
  1427. 0: (c)
  1428. ((ab))
  1429. 0: ((ab))
  1430. \= Expect no match
  1431. ()
  1432. No match
  1433. /\( (?: (?>[^()]+) | (?R) )? \) /Ix
  1434. Capture group count = 0
  1435. Options: extended
  1436. First code unit = '('
  1437. Last code unit = ')'
  1438. Subject length lower bound = 2
  1439. ()
  1440. 0: ()
  1441. 12(abcde(fsh)xyz(foo(bar))lmno)89
  1442. 0: (fsh)
  1443. /\( ( (?>[^()]+) | (?R) )* \) /Ix
  1444. Capture group count = 1
  1445. Options: extended
  1446. First code unit = '('
  1447. Last code unit = ')'
  1448. Subject length lower bound = 2
  1449. (ab(xy)cd)
  1450. 0: (ab(xy)cd)
  1451. 1: cd
  1452. /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
  1453. Capture group count = 2
  1454. Options: extended
  1455. First code unit = '('
  1456. Last code unit = ')'
  1457. Subject length lower bound = 2
  1458. (ab(xy)cd)
  1459. 0: (ab(xy)cd)
  1460. 1: ab(xy)cd
  1461. 2: cd
  1462. /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
  1463. Capture group count = 3
  1464. Options: extended
  1465. First code unit = '('
  1466. Last code unit = ')'
  1467. Subject length lower bound = 2
  1468. (ab(xy)cd)
  1469. 0: (ab(xy)cd)
  1470. 1: <unset>
  1471. 2: ab(xy)cd
  1472. 3: cd
  1473. (123ab(xy)cd)
  1474. 0: (123ab(xy)cd)
  1475. 1: 123
  1476. 2: ab(xy)cd
  1477. 3: cd
  1478. /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
  1479. Capture group count = 3
  1480. Options: extended
  1481. First code unit = '('
  1482. Last code unit = ')'
  1483. Subject length lower bound = 2
  1484. (ab(xy)cd)
  1485. 0: (ab(xy)cd)
  1486. 1: ab(xy)cd
  1487. 2: <unset>
  1488. 3: cd
  1489. (123ab(xy)cd)
  1490. 0: (123ab(xy)cd)
  1491. 1: 123ab(xy)cd
  1492. 2: 123
  1493. 3: cd
  1494. /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
  1495. Capture group count = 11
  1496. Options: extended
  1497. First code unit = '('
  1498. Last code unit = ')'
  1499. Subject length lower bound = 2
  1500. (ab(xy)cd)
  1501. 0: (ab(xy)cd)
  1502. 1: ab(xy)cd
  1503. 2: ab(xy)cd
  1504. 3: ab(xy)cd
  1505. 4: ab(xy)cd
  1506. 5: ab(xy)cd
  1507. 6: ab(xy)cd
  1508. 7: ab(xy)cd
  1509. 8: ab(xy)cd
  1510. 9: ab(xy)cd
  1511. 10: ab(xy)cd
  1512. 11: cd
  1513. /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
  1514. Capture group count = 3
  1515. Options: extended
  1516. First code unit = '('
  1517. Last code unit = ')'
  1518. Subject length lower bound = 2
  1519. (abcd(xyz<p>qrs)123)
  1520. 0: (abcd(xyz<p>qrs)123)
  1521. 1: abcd(xyz<p>qrs)123
  1522. 2: 123
  1523. /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
  1524. Capture group count = 3
  1525. Options: extended
  1526. First code unit = '('
  1527. Last code unit = ')'
  1528. Subject length lower bound = 2
  1529. (ab(cd)ef)
  1530. 0: (ab(cd)ef)
  1531. 1: ab(cd)ef
  1532. 2: ef
  1533. 3: (cd)
  1534. (ab(cd(ef)gh)ij)
  1535. 0: (ab(cd(ef)gh)ij)
  1536. 1: ab(cd(ef)gh)ij
  1537. 2: ij
  1538. 3: (cd(ef)gh)
  1539. /^[[:alnum:]]/IB
  1540. ------------------------------------------------------------------
  1541. Bra
  1542. ^
  1543. [0-9A-Za-z]
  1544. Ket
  1545. End
  1546. ------------------------------------------------------------------
  1547. Capture group count = 0
  1548. Compile options: <none>
  1549. Overall options: anchored
  1550. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1551. Q R S T U V W X Y Z 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
  1552. Subject length lower bound = 1
  1553. /^[[:^alnum:]]/IB
  1554. ------------------------------------------------------------------
  1555. Bra
  1556. ^
  1557. [\x00-/:-@[-`{-\xff] (neg)
  1558. Ket
  1559. End
  1560. ------------------------------------------------------------------
  1561. Capture group count = 0
  1562. Compile options: <none>
  1563. Overall options: anchored
  1564. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1565. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1566. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
  1567. ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88
  1568. \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97
  1569. \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6
  1570. \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5
  1571. \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4
  1572. \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3
  1573. \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2
  1574. \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1
  1575. \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1576. Subject length lower bound = 1
  1577. /^[[:alpha:]]/IB
  1578. ------------------------------------------------------------------
  1579. Bra
  1580. ^
  1581. [A-Za-z]
  1582. Ket
  1583. End
  1584. ------------------------------------------------------------------
  1585. Capture group count = 0
  1586. Compile options: <none>
  1587. Overall options: anchored
  1588. Starting code units: 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
  1589. 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
  1590. Subject length lower bound = 1
  1591. /^[[:^alpha:]]/IB
  1592. ------------------------------------------------------------------
  1593. Bra
  1594. ^
  1595. [\x00-@[-`{-\xff] (neg)
  1596. Ket
  1597. End
  1598. ------------------------------------------------------------------
  1599. Capture group count = 0
  1600. Compile options: <none>
  1601. Overall options: anchored
  1602. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1603. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1604. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
  1605. 5 6 7 8 9 : ; < = > ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
  1606. \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
  1607. \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2
  1608. \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1
  1609. \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0
  1610. \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf
  1611. \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde
  1612. \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed
  1613. \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc
  1614. \xfd \xfe \xff
  1615. Subject length lower bound = 1
  1616. /[_[:alpha:]]/I
  1617. Capture group count = 0
  1618. Starting code units: 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
  1619. _ 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
  1620. Subject length lower bound = 1
  1621. /^[[:ascii:]]/IB
  1622. ------------------------------------------------------------------
  1623. Bra
  1624. ^
  1625. [\x00-\x7f]
  1626. Ket
  1627. End
  1628. ------------------------------------------------------------------
  1629. Capture group count = 0
  1630. Compile options: <none>
  1631. Overall options: anchored
  1632. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1633. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1634. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
  1635. 5 6 7 8 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
  1636. Z [ \ ] ^ _ ` 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 { | } ~
  1637. \x7f
  1638. Subject length lower bound = 1
  1639. /^[[:^ascii:]]/IB
  1640. ------------------------------------------------------------------
  1641. Bra
  1642. ^
  1643. [\x80-\xff] (neg)
  1644. Ket
  1645. End
  1646. ------------------------------------------------------------------
  1647. Capture group count = 0
  1648. Compile options: <none>
  1649. Overall options: anchored
  1650. Starting code units: \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a
  1651. \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99
  1652. \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8
  1653. \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7
  1654. \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6
  1655. \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5
  1656. \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4
  1657. \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3
  1658. \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1659. Subject length lower bound = 1
  1660. /^[[:blank:]]/IB
  1661. ------------------------------------------------------------------
  1662. Bra
  1663. ^
  1664. [\x09 ]
  1665. Ket
  1666. End
  1667. ------------------------------------------------------------------
  1668. Capture group count = 0
  1669. Compile options: <none>
  1670. Overall options: anchored
  1671. Starting code units: \x09 \x20
  1672. Subject length lower bound = 1
  1673. /^[[:^blank:]]/IB
  1674. ------------------------------------------------------------------
  1675. Bra
  1676. ^
  1677. [\x00-\x08\x0a-\x1f!-\xff] (neg)
  1678. Ket
  1679. End
  1680. ------------------------------------------------------------------
  1681. Capture group count = 0
  1682. Compile options: <none>
  1683. Overall options: anchored
  1684. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
  1685. \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
  1686. \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
  1687. : ; < = > ? @ 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 [ \ ] ^
  1688. _ ` 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 { | } ~ \x7f \x80
  1689. \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
  1690. \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
  1691. \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad
  1692. \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc
  1693. \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb
  1694. \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda
  1695. \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9
  1696. \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8
  1697. \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1698. Subject length lower bound = 1
  1699. /[\n\x0b\x0c\x0d[:blank:]]/I
  1700. Capture group count = 0
  1701. Contains explicit CR or LF match
  1702. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  1703. Subject length lower bound = 1
  1704. /^[[:cntrl:]]/IB
  1705. ------------------------------------------------------------------
  1706. Bra
  1707. ^
  1708. [\x00-\x1f\x7f]
  1709. Ket
  1710. End
  1711. ------------------------------------------------------------------
  1712. Capture group count = 0
  1713. Compile options: <none>
  1714. Overall options: anchored
  1715. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1716. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1717. \x1a \x1b \x1c \x1d \x1e \x1f \x7f
  1718. Subject length lower bound = 1
  1719. /^[[:digit:]]/IB
  1720. ------------------------------------------------------------------
  1721. Bra
  1722. ^
  1723. [0-9]
  1724. Ket
  1725. End
  1726. ------------------------------------------------------------------
  1727. Capture group count = 0
  1728. Compile options: <none>
  1729. Overall options: anchored
  1730. Starting code units: 0 1 2 3 4 5 6 7 8 9
  1731. Subject length lower bound = 1
  1732. /^[[:graph:]]/IB
  1733. ------------------------------------------------------------------
  1734. Bra
  1735. ^
  1736. [!-~]
  1737. Ket
  1738. End
  1739. ------------------------------------------------------------------
  1740. Capture group count = 0
  1741. Compile options: <none>
  1742. Overall options: anchored
  1743. Starting code units: ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :
  1744. ; < = > ? @ 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 [ \ ] ^ _
  1745. ` 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 { | } ~
  1746. Subject length lower bound = 1
  1747. /^[[:lower:]]/IB
  1748. ------------------------------------------------------------------
  1749. Bra
  1750. ^
  1751. [a-z]
  1752. Ket
  1753. End
  1754. ------------------------------------------------------------------
  1755. Capture group count = 0
  1756. Compile options: <none>
  1757. Overall options: anchored
  1758. Starting code units: 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
  1759. Subject length lower bound = 1
  1760. /^[[:print:]]/IB
  1761. ------------------------------------------------------------------
  1762. Bra
  1763. ^
  1764. [ -~]
  1765. Ket
  1766. End
  1767. ------------------------------------------------------------------
  1768. Capture group count = 0
  1769. Compile options: <none>
  1770. Overall options: anchored
  1771. Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8
  1772. 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 [ \ ]
  1773. ^ _ ` 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 { | } ~
  1774. Subject length lower bound = 1
  1775. /^[[:punct:]]/IB
  1776. ------------------------------------------------------------------
  1777. Bra
  1778. ^
  1779. [!-/:-@[-`{-~]
  1780. Ket
  1781. End
  1782. ------------------------------------------------------------------
  1783. Capture group count = 0
  1784. Compile options: <none>
  1785. Overall options: anchored
  1786. Starting code units: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^
  1787. _ ` { | } ~
  1788. Subject length lower bound = 1
  1789. /^[[:space:]]/IB
  1790. ------------------------------------------------------------------
  1791. Bra
  1792. ^
  1793. [\x09-\x0d ]
  1794. Ket
  1795. End
  1796. ------------------------------------------------------------------
  1797. Capture group count = 0
  1798. Compile options: <none>
  1799. Overall options: anchored
  1800. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  1801. Subject length lower bound = 1
  1802. /^[[:upper:]]/IB
  1803. ------------------------------------------------------------------
  1804. Bra
  1805. ^
  1806. [A-Z]
  1807. Ket
  1808. End
  1809. ------------------------------------------------------------------
  1810. Capture group count = 0
  1811. Compile options: <none>
  1812. Overall options: anchored
  1813. Starting code units: 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
  1814. Subject length lower bound = 1
  1815. /^[[:xdigit:]]/IB
  1816. ------------------------------------------------------------------
  1817. Bra
  1818. ^
  1819. [0-9A-Fa-f]
  1820. Ket
  1821. End
  1822. ------------------------------------------------------------------
  1823. Capture group count = 0
  1824. Compile options: <none>
  1825. Overall options: anchored
  1826. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
  1827. Subject length lower bound = 1
  1828. /^[[:word:]]/IB
  1829. ------------------------------------------------------------------
  1830. Bra
  1831. ^
  1832. [0-9A-Z_a-z]
  1833. Ket
  1834. End
  1835. ------------------------------------------------------------------
  1836. Capture group count = 0
  1837. Compile options: <none>
  1838. Overall options: anchored
  1839. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1840. Q R S T U V W X Y Z _ 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
  1841. Subject length lower bound = 1
  1842. /^[[:^cntrl:]]/IB
  1843. ------------------------------------------------------------------
  1844. Bra
  1845. ^
  1846. [ -~\x80-\xff] (neg)
  1847. Ket
  1848. End
  1849. ------------------------------------------------------------------
  1850. Capture group count = 0
  1851. Compile options: <none>
  1852. Overall options: anchored
  1853. Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8
  1854. 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 [ \ ]
  1855. ^ _ ` 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 { | } ~ \x80 \x81
  1856. \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90
  1857. \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f
  1858. \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
  1859. \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
  1860. \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
  1861. \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
  1862. \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
  1863. \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
  1864. \xfa \xfb \xfc \xfd \xfe \xff
  1865. Subject length lower bound = 1
  1866. /^[12[:^digit:]]/IB
  1867. ------------------------------------------------------------------
  1868. Bra
  1869. ^
  1870. [\x00-/12:-\xff] (neg)
  1871. Ket
  1872. End
  1873. ------------------------------------------------------------------
  1874. Capture group count = 0
  1875. Compile options: <none>
  1876. Overall options: anchored
  1877. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1878. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1879. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 1 2 : ; <
  1880. = > ? @ 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
  1881. 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 { | } ~ \x7f \x80 \x81 \x82
  1882. \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91
  1883. \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0
  1884. \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf
  1885. \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe
  1886. \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd
  1887. \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc
  1888. \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb
  1889. \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa
  1890. \xfb \xfc \xfd \xfe \xff
  1891. Subject length lower bound = 1
  1892. /^[[:^blank:]]/IB
  1893. ------------------------------------------------------------------
  1894. Bra
  1895. ^
  1896. [\x00-\x08\x0a-\x1f!-\xff] (neg)
  1897. Ket
  1898. End
  1899. ------------------------------------------------------------------
  1900. Capture group count = 0
  1901. Compile options: <none>
  1902. Overall options: anchored
  1903. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
  1904. \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
  1905. \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
  1906. : ; < = > ? @ 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 [ \ ] ^
  1907. _ ` 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 { | } ~ \x7f \x80
  1908. \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
  1909. \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
  1910. \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad
  1911. \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc
  1912. \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb
  1913. \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda
  1914. \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9
  1915. \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8
  1916. \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1917. Subject length lower bound = 1
  1918. /[01[:alpha:]%]/IB
  1919. ------------------------------------------------------------------
  1920. Bra
  1921. [%01A-Za-z]
  1922. Ket
  1923. End
  1924. ------------------------------------------------------------------
  1925. Capture group count = 0
  1926. Starting code units: % 0 1 A B C D E F G H I J K L M N O P Q R S T U V W
  1927. X Y Z 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
  1928. Subject length lower bound = 1
  1929. /[[.ch.]]/I
  1930. Failed: error 113 at offset 1: POSIX collating elements are not supported
  1931. /[[=ch=]]/I
  1932. Failed: error 113 at offset 1: POSIX collating elements are not supported
  1933. /[[:rhubarb:]]/I
  1934. Failed: error 130 at offset 3: unknown POSIX class name
  1935. /[[:upper:]]/Ii
  1936. Capture group count = 0
  1937. Options: caseless
  1938. Starting code units: 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
  1939. 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
  1940. Subject length lower bound = 1
  1941. A
  1942. 0: A
  1943. a
  1944. 0: a
  1945. /[[:lower:]]/Ii
  1946. Capture group count = 0
  1947. Options: caseless
  1948. Starting code units: 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
  1949. 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
  1950. Subject length lower bound = 1
  1951. A
  1952. 0: A
  1953. a
  1954. 0: a
  1955. /((?-i)[[:lower:]])[[:lower:]]/Ii
  1956. Capture group count = 1
  1957. Options: caseless
  1958. Starting code units: 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
  1959. Subject length lower bound = 2
  1960. ab
  1961. 0: ab
  1962. 1: a
  1963. aB
  1964. 0: aB
  1965. 1: a
  1966. \= Expect no match
  1967. Ab
  1968. No match
  1969. AB
  1970. No match
  1971. /[\200-\110]/I
  1972. Failed: error 108 at offset 9: range out of order in character class
  1973. /^(?(0)f|b)oo/I
  1974. Failed: error 115 at offset 5: reference to non-existent subpattern
  1975. # This one's here because of the large output vector needed
  1976. /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
  1977. Capture group count = 271
  1978. Max back reference = 270
  1979. Starting code units: 0 1 2 3 4 5 6 7 8 9
  1980. Subject length lower bound = 1
  1981. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC\=ovector=300
  1982. 0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
  1983. 1: 1
  1984. 2: 2
  1985. 3: 3
  1986. 4: 4
  1987. 5: 5
  1988. 6: 6
  1989. 7: 7
  1990. 8: 8
  1991. 9: 9
  1992. 10: 10
  1993. 11: 11
  1994. 12: 12
  1995. 13: 13
  1996. 14: 14
  1997. 15: 15
  1998. 16: 16
  1999. 17: 17
  2000. 18: 18
  2001. 19: 19
  2002. 20: 20
  2003. 21: 21
  2004. 22: 22
  2005. 23: 23
  2006. 24: 24
  2007. 25: 25
  2008. 26: 26
  2009. 27: 27
  2010. 28: 28
  2011. 29: 29
  2012. 30: 30
  2013. 31: 31
  2014. 32: 32
  2015. 33: 33
  2016. 34: 34
  2017. 35: 35
  2018. 36: 36
  2019. 37: 37
  2020. 38: 38
  2021. 39: 39
  2022. 40: 40
  2023. 41: 41
  2024. 42: 42
  2025. 43: 43
  2026. 44: 44
  2027. 45: 45
  2028. 46: 46
  2029. 47: 47
  2030. 48: 48
  2031. 49: 49
  2032. 50: 50
  2033. 51: 51
  2034. 52: 52
  2035. 53: 53
  2036. 54: 54
  2037. 55: 55
  2038. 56: 56
  2039. 57: 57
  2040. 58: 58
  2041. 59: 59
  2042. 60: 60
  2043. 61: 61
  2044. 62: 62
  2045. 63: 63
  2046. 64: 64
  2047. 65: 65
  2048. 66: 66
  2049. 67: 67
  2050. 68: 68
  2051. 69: 69
  2052. 70: 70
  2053. 71: 71
  2054. 72: 72
  2055. 73: 73
  2056. 74: 74
  2057. 75: 75
  2058. 76: 76
  2059. 77: 77
  2060. 78: 78
  2061. 79: 79
  2062. 80: 80
  2063. 81: 81
  2064. 82: 82
  2065. 83: 83
  2066. 84: 84
  2067. 85: 85
  2068. 86: 86
  2069. 87: 87
  2070. 88: 88
  2071. 89: 89
  2072. 90: 90
  2073. 91: 91
  2074. 92: 92
  2075. 93: 93
  2076. 94: 94
  2077. 95: 95
  2078. 96: 96
  2079. 97: 97
  2080. 98: 98
  2081. 99: 99
  2082. 100: 100
  2083. 101: 101
  2084. 102: 102
  2085. 103: 103
  2086. 104: 104
  2087. 105: 105
  2088. 106: 106
  2089. 107: 107
  2090. 108: 108
  2091. 109: 109
  2092. 110: 110
  2093. 111: 111
  2094. 112: 112
  2095. 113: 113
  2096. 114: 114
  2097. 115: 115
  2098. 116: 116
  2099. 117: 117
  2100. 118: 118
  2101. 119: 119
  2102. 120: 120
  2103. 121: 121
  2104. 122: 122
  2105. 123: 123
  2106. 124: 124
  2107. 125: 125
  2108. 126: 126
  2109. 127: 127
  2110. 128: 128
  2111. 129: 129
  2112. 130: 130
  2113. 131: 131
  2114. 132: 132
  2115. 133: 133
  2116. 134: 134
  2117. 135: 135
  2118. 136: 136
  2119. 137: 137
  2120. 138: 138
  2121. 139: 139
  2122. 140: 140
  2123. 141: 141
  2124. 142: 142
  2125. 143: 143
  2126. 144: 144
  2127. 145: 145
  2128. 146: 146
  2129. 147: 147
  2130. 148: 148
  2131. 149: 149
  2132. 150: 150
  2133. 151: 151
  2134. 152: 152
  2135. 153: 153
  2136. 154: 154
  2137. 155: 155
  2138. 156: 156
  2139. 157: 157
  2140. 158: 158
  2141. 159: 159
  2142. 160: 160
  2143. 161: 161
  2144. 162: 162
  2145. 163: 163
  2146. 164: 164
  2147. 165: 165
  2148. 166: 166
  2149. 167: 167
  2150. 168: 168
  2151. 169: 169
  2152. 170: 170
  2153. 171: 171
  2154. 172: 172
  2155. 173: 173
  2156. 174: 174
  2157. 175: 175
  2158. 176: 176
  2159. 177: 177
  2160. 178: 178
  2161. 179: 179
  2162. 180: 180
  2163. 181: 181
  2164. 182: 182
  2165. 183: 183
  2166. 184: 184
  2167. 185: 185
  2168. 186: 186
  2169. 187: 187
  2170. 188: 188
  2171. 189: 189
  2172. 190: 190
  2173. 191: 191
  2174. 192: 192
  2175. 193: 193
  2176. 194: 194
  2177. 195: 195
  2178. 196: 196
  2179. 197: 197
  2180. 198: 198
  2181. 199: 199
  2182. 200: 200
  2183. 201: 201
  2184. 202: 202
  2185. 203: 203
  2186. 204: 204
  2187. 205: 205
  2188. 206: 206
  2189. 207: 207
  2190. 208: 208
  2191. 209: 209
  2192. 210: 210
  2193. 211: 211
  2194. 212: 212
  2195. 213: 213
  2196. 214: 214
  2197. 215: 215
  2198. 216: 216
  2199. 217: 217
  2200. 218: 218
  2201. 219: 219
  2202. 220: 220
  2203. 221: 221
  2204. 222: 222
  2205. 223: 223
  2206. 224: 224
  2207. 225: 225
  2208. 226: 226
  2209. 227: 227
  2210. 228: 228
  2211. 229: 229
  2212. 230: 230
  2213. 231: 231
  2214. 232: 232
  2215. 233: 233
  2216. 234: 234
  2217. 235: 235
  2218. 236: 236
  2219. 237: 237
  2220. 238: 238
  2221. 239: 239
  2222. 240: 240
  2223. 241: 241
  2224. 242: 242
  2225. 243: 243
  2226. 244: 244
  2227. 245: 245
  2228. 246: 246
  2229. 247: 247
  2230. 248: 248
  2231. 249: 249
  2232. 250: 250
  2233. 251: 251
  2234. 252: 252
  2235. 253: 253
  2236. 254: 254
  2237. 255: 255
  2238. 256: 256
  2239. 257: 257
  2240. 258: 258
  2241. 259: 259
  2242. 260: 260
  2243. 261: 261
  2244. 262: 262
  2245. 263: 263
  2246. 264: 264
  2247. 265: 265
  2248. 266: 266
  2249. 267: 267
  2250. 268: 268
  2251. 269: 269
  2252. 270: ABC
  2253. 271: ABC
  2254. # This one's here because Perl does this differently and PCRE2 can't at present
  2255. /(main(O)?)+/I
  2256. Capture group count = 2
  2257. First code unit = 'm'
  2258. Last code unit = 'n'
  2259. Subject length lower bound = 4
  2260. mainmain
  2261. 0: mainmain
  2262. 1: main
  2263. mainOmain
  2264. 0: mainOmain
  2265. 1: main
  2266. 2: O
  2267. # These are all cases where Perl does it differently (nested captures)
  2268. /^(a(b)?)+$/I
  2269. Capture group count = 2
  2270. Compile options: <none>
  2271. Overall options: anchored
  2272. First code unit = 'a'
  2273. Subject length lower bound = 1
  2274. aba
  2275. 0: aba
  2276. 1: a
  2277. 2: b
  2278. /^(aa(bb)?)+$/I
  2279. Capture group count = 2
  2280. Compile options: <none>
  2281. Overall options: anchored
  2282. First code unit = 'a'
  2283. Subject length lower bound = 2
  2284. aabbaa
  2285. 0: aabbaa
  2286. 1: aa
  2287. 2: bb
  2288. /^(aa|aa(bb))+$/I
  2289. Capture group count = 2
  2290. Compile options: <none>
  2291. Overall options: anchored
  2292. First code unit = 'a'
  2293. Subject length lower bound = 2
  2294. aabbaa
  2295. 0: aabbaa
  2296. 1: aa
  2297. 2: bb
  2298. /^(aa(bb)??)+$/I
  2299. Capture group count = 2
  2300. Compile options: <none>
  2301. Overall options: anchored
  2302. First code unit = 'a'
  2303. Subject length lower bound = 2
  2304. aabbaa
  2305. 0: aabbaa
  2306. 1: aa
  2307. 2: bb
  2308. /^(?:aa(bb)?)+$/I
  2309. Capture group count = 1
  2310. Compile options: <none>
  2311. Overall options: anchored
  2312. First code unit = 'a'
  2313. Subject length lower bound = 2
  2314. aabbaa
  2315. 0: aabbaa
  2316. 1: bb
  2317. /^(aa(b(b))?)+$/I
  2318. Capture group count = 3
  2319. Compile options: <none>
  2320. Overall options: anchored
  2321. First code unit = 'a'
  2322. Subject length lower bound = 2
  2323. aabbaa
  2324. 0: aabbaa
  2325. 1: aa
  2326. 2: bb
  2327. 3: b
  2328. /^(?:aa(b(b))?)+$/I
  2329. Capture group count = 2
  2330. Compile options: <none>
  2331. Overall options: anchored
  2332. First code unit = 'a'
  2333. Subject length lower bound = 2
  2334. aabbaa
  2335. 0: aabbaa
  2336. 1: bb
  2337. 2: b
  2338. /^(?:aa(b(?:b))?)+$/I
  2339. Capture group count = 1
  2340. Compile options: <none>
  2341. Overall options: anchored
  2342. First code unit = 'a'
  2343. Subject length lower bound = 2
  2344. aabbaa
  2345. 0: aabbaa
  2346. 1: bb
  2347. /^(?:aa(bb(?:b))?)+$/I
  2348. Capture group count = 1
  2349. Compile options: <none>
  2350. Overall options: anchored
  2351. First code unit = 'a'
  2352. Subject length lower bound = 2
  2353. aabbbaa
  2354. 0: aabbbaa
  2355. 1: bbb
  2356. /^(?:aa(b(?:bb))?)+$/I
  2357. Capture group count = 1
  2358. Compile options: <none>
  2359. Overall options: anchored
  2360. First code unit = 'a'
  2361. Subject length lower bound = 2
  2362. aabbbaa
  2363. 0: aabbbaa
  2364. 1: bbb
  2365. /^(?:aa(?:b(b))?)+$/I
  2366. Capture group count = 1
  2367. Compile options: <none>
  2368. Overall options: anchored
  2369. First code unit = 'a'
  2370. Subject length lower bound = 2
  2371. aabbaa
  2372. 0: aabbaa
  2373. 1: b
  2374. /^(?:aa(?:b(bb))?)+$/I
  2375. Capture group count = 1
  2376. Compile options: <none>
  2377. Overall options: anchored
  2378. First code unit = 'a'
  2379. Subject length lower bound = 2
  2380. aabbbaa
  2381. 0: aabbbaa
  2382. 1: bb
  2383. /^(aa(b(bb))?)+$/I
  2384. Capture group count = 3
  2385. Compile options: <none>
  2386. Overall options: anchored
  2387. First code unit = 'a'
  2388. Subject length lower bound = 2
  2389. aabbbaa
  2390. 0: aabbbaa
  2391. 1: aa
  2392. 2: bbb
  2393. 3: bb
  2394. /^(aa(bb(bb))?)+$/I
  2395. Capture group count = 3
  2396. Compile options: <none>
  2397. Overall options: anchored
  2398. First code unit = 'a'
  2399. Subject length lower bound = 2
  2400. aabbbbaa
  2401. 0: aabbbbaa
  2402. 1: aa
  2403. 2: bbbb
  2404. 3: bb
  2405. # ----------------
  2406. /#/IBx
  2407. ------------------------------------------------------------------
  2408. Bra
  2409. Ket
  2410. End
  2411. ------------------------------------------------------------------
  2412. Capture group count = 0
  2413. May match empty string
  2414. Options: extended
  2415. Subject length lower bound = 0
  2416. /a#/IBx
  2417. ------------------------------------------------------------------
  2418. Bra
  2419. a
  2420. Ket
  2421. End
  2422. ------------------------------------------------------------------
  2423. Capture group count = 0
  2424. Options: extended
  2425. First code unit = 'a'
  2426. Subject length lower bound = 1
  2427. /[\s]/IB
  2428. ------------------------------------------------------------------
  2429. Bra
  2430. [\x09-\x0d ]
  2431. Ket
  2432. End
  2433. ------------------------------------------------------------------
  2434. Capture group count = 0
  2435. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2436. Subject length lower bound = 1
  2437. /[\S]/IB
  2438. ------------------------------------------------------------------
  2439. Bra
  2440. [\x00-\x08\x0e-\x1f!-\xff] (neg)
  2441. Ket
  2442. End
  2443. ------------------------------------------------------------------
  2444. Capture group count = 0
  2445. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f
  2446. \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e
  2447. \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
  2448. 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 f g h
  2449. i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
  2450. \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
  2451. \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2
  2452. \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1
  2453. \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0
  2454. \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf
  2455. \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde
  2456. \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed
  2457. \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc
  2458. \xfd \xfe \xff
  2459. Subject length lower bound = 1
  2460. /a(?i)b/IB
  2461. ------------------------------------------------------------------
  2462. Bra
  2463. a
  2464. /i b
  2465. Ket
  2466. End
  2467. ------------------------------------------------------------------
  2468. Capture group count = 0
  2469. First code unit = 'a'
  2470. Last code unit = 'b' (caseless)
  2471. Subject length lower bound = 2
  2472. ab
  2473. 0: ab
  2474. aB
  2475. 0: aB
  2476. \= Expect no match
  2477. AB
  2478. No match
  2479. /(a(?i)b)/IB
  2480. ------------------------------------------------------------------
  2481. Bra
  2482. CBra 1
  2483. a
  2484. /i b
  2485. Ket
  2486. Ket
  2487. End
  2488. ------------------------------------------------------------------
  2489. Capture group count = 1
  2490. First code unit = 'a'
  2491. Last code unit = 'b' (caseless)
  2492. Subject length lower bound = 2
  2493. ab
  2494. 0: ab
  2495. 1: ab
  2496. aB
  2497. 0: aB
  2498. 1: aB
  2499. \= Expect no match
  2500. AB
  2501. No match
  2502. / (?i)abc/IBx
  2503. ------------------------------------------------------------------
  2504. Bra
  2505. /i abc
  2506. Ket
  2507. End
  2508. ------------------------------------------------------------------
  2509. Capture group count = 0
  2510. Options: extended
  2511. First code unit = 'a' (caseless)
  2512. Last code unit = 'c' (caseless)
  2513. Subject length lower bound = 3
  2514. /#this is a comment
  2515. (?i)abc/IBx
  2516. ------------------------------------------------------------------
  2517. Bra
  2518. /i abc
  2519. Ket
  2520. End
  2521. ------------------------------------------------------------------
  2522. Capture group count = 0
  2523. Options: extended
  2524. First code unit = 'a' (caseless)
  2525. Last code unit = 'c' (caseless)
  2526. Subject length lower bound = 3
  2527. /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
  2528. ------------------------------------------------------------------
  2529. Bra
  2530. 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  2531. Ket
  2532. End
  2533. ------------------------------------------------------------------
  2534. Capture group count = 0
  2535. First code unit = '1'
  2536. Last code unit = '0'
  2537. Subject length lower bound = 300
  2538. /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
  2539. ------------------------------------------------------------------
  2540. Bra
  2541. 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  2542. Ket
  2543. End
  2544. ------------------------------------------------------------------
  2545. Capture group count = 0
  2546. First code unit = '1'
  2547. Last code unit = '0'
  2548. Subject length lower bound = 300
  2549. /\Q\E/IB
  2550. ------------------------------------------------------------------
  2551. Bra
  2552. Ket
  2553. End
  2554. ------------------------------------------------------------------
  2555. Capture group count = 0
  2556. May match empty string
  2557. Subject length lower bound = 0
  2558. \
  2559. 0:
  2560. /\Q\Ex/IB
  2561. ------------------------------------------------------------------
  2562. Bra
  2563. x
  2564. Ket
  2565. End
  2566. ------------------------------------------------------------------
  2567. Capture group count = 0
  2568. First code unit = 'x'
  2569. Subject length lower bound = 1
  2570. / \Q\E/IB
  2571. ------------------------------------------------------------------
  2572. Bra
  2573. Ket
  2574. End
  2575. ------------------------------------------------------------------
  2576. Capture group count = 0
  2577. First code unit = ' '
  2578. Subject length lower bound = 1
  2579. /a\Q\E/IB
  2580. ------------------------------------------------------------------
  2581. Bra
  2582. a
  2583. Ket
  2584. End
  2585. ------------------------------------------------------------------
  2586. Capture group count = 0
  2587. First code unit = 'a'
  2588. Subject length lower bound = 1
  2589. abc
  2590. 0: a
  2591. bca
  2592. 0: a
  2593. bac
  2594. 0: a
  2595. /a\Q\Eb/IB
  2596. ------------------------------------------------------------------
  2597. Bra
  2598. ab
  2599. Ket
  2600. End
  2601. ------------------------------------------------------------------
  2602. Capture group count = 0
  2603. First code unit = 'a'
  2604. Last code unit = 'b'
  2605. Subject length lower bound = 2
  2606. abc
  2607. 0: ab
  2608. /\Q\Eabc/IB
  2609. ------------------------------------------------------------------
  2610. Bra
  2611. abc
  2612. Ket
  2613. End
  2614. ------------------------------------------------------------------
  2615. Capture group count = 0
  2616. First code unit = 'a'
  2617. Last code unit = 'c'
  2618. Subject length lower bound = 3
  2619. /x*+\w/IB
  2620. ------------------------------------------------------------------
  2621. Bra
  2622. x*+
  2623. \w
  2624. Ket
  2625. End
  2626. ------------------------------------------------------------------
  2627. Capture group count = 0
  2628. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  2629. Q R S T U V W X Y Z _ 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
  2630. Subject length lower bound = 1
  2631. \= Expect no match
  2632. xxxxx
  2633. No match
  2634. /x?+/IB
  2635. ------------------------------------------------------------------
  2636. Bra
  2637. x?+
  2638. Ket
  2639. End
  2640. ------------------------------------------------------------------
  2641. Capture group count = 0
  2642. May match empty string
  2643. Subject length lower bound = 0
  2644. /x++/IB
  2645. ------------------------------------------------------------------
  2646. Bra
  2647. x++
  2648. Ket
  2649. End
  2650. ------------------------------------------------------------------
  2651. Capture group count = 0
  2652. First code unit = 'x'
  2653. Subject length lower bound = 1
  2654. /x{1,3}+/B,no_auto_possess
  2655. ------------------------------------------------------------------
  2656. Bra
  2657. x
  2658. x{0,2}+
  2659. Ket
  2660. End
  2661. ------------------------------------------------------------------
  2662. /x{1,3}+/Bi,no_auto_possess
  2663. ------------------------------------------------------------------
  2664. Bra
  2665. /i x
  2666. /i x{0,2}+
  2667. Ket
  2668. End
  2669. ------------------------------------------------------------------
  2670. /[^x]{1,3}+/B,no_auto_possess
  2671. ------------------------------------------------------------------
  2672. Bra
  2673. [^x]
  2674. [^x]{0,2}+
  2675. Ket
  2676. End
  2677. ------------------------------------------------------------------
  2678. /[^x]{1,3}+/Bi,no_auto_possess
  2679. ------------------------------------------------------------------
  2680. Bra
  2681. /i [^x]
  2682. /i [^x]{0,2}+
  2683. Ket
  2684. End
  2685. ------------------------------------------------------------------
  2686. /(x)*+/IB
  2687. ------------------------------------------------------------------
  2688. Bra
  2689. Braposzero
  2690. CBraPos 1
  2691. x
  2692. KetRpos
  2693. Ket
  2694. End
  2695. ------------------------------------------------------------------
  2696. Capture group count = 1
  2697. May match empty string
  2698. Subject length lower bound = 0
  2699. /^(\w++|\s++)*$/I
  2700. Capture group count = 1
  2701. May match empty string
  2702. Compile options: <none>
  2703. Overall options: anchored
  2704. Subject length lower bound = 0
  2705. now is the time for all good men to come to the aid of the party
  2706. 0: now is the time for all good men to come to the aid of the party
  2707. 1: party
  2708. \= Expect no match
  2709. this is not a line with only words and spaces!
  2710. No match
  2711. /(\d++)(\w)/I
  2712. Capture group count = 2
  2713. Starting code units: 0 1 2 3 4 5 6 7 8 9
  2714. Subject length lower bound = 2
  2715. 12345a
  2716. 0: 12345a
  2717. 1: 12345
  2718. 2: a
  2719. \= Expect no match
  2720. 12345+
  2721. No match
  2722. /a++b/I
  2723. Capture group count = 0
  2724. First code unit = 'a'
  2725. Last code unit = 'b'
  2726. Subject length lower bound = 2
  2727. aaab
  2728. 0: aaab
  2729. /(a++b)/I
  2730. Capture group count = 1
  2731. First code unit = 'a'
  2732. Last code unit = 'b'
  2733. Subject length lower bound = 2
  2734. aaab
  2735. 0: aaab
  2736. 1: aaab
  2737. /(a++)b/I
  2738. Capture group count = 1
  2739. First code unit = 'a'
  2740. Last code unit = 'b'
  2741. Subject length lower bound = 2
  2742. aaab
  2743. 0: aaab
  2744. 1: aaa
  2745. /([^()]++|\([^()]*\))+/I
  2746. Capture group count = 1
  2747. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  2748. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  2749. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( * + , - . / 0 1 2 3 4 5
  2750. 6 7 8 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
  2751. [ \ ] ^ _ ` 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 { | } ~ \x7f
  2752. \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e
  2753. \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d
  2754. \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac
  2755. \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb
  2756. \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca
  2757. \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9
  2758. \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8
  2759. \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7
  2760. \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  2761. Subject length lower bound = 1
  2762. ((abc(ade)ufh()()x
  2763. 0: abc(ade)ufh()()x
  2764. 1: x
  2765. /\(([^()]++|\([^()]+\))+\)/I
  2766. Capture group count = 1
  2767. First code unit = '('
  2768. Last code unit = ')'
  2769. Subject length lower bound = 3
  2770. (abc)
  2771. 0: (abc)
  2772. 1: abc
  2773. (abc(def)xyz)
  2774. 0: (abc(def)xyz)
  2775. 1: xyz
  2776. \= Expect no match
  2777. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  2778. No match
  2779. /(abc){1,3}+/IB
  2780. ------------------------------------------------------------------
  2781. Bra
  2782. Once
  2783. CBra 1
  2784. abc
  2785. Ket
  2786. Brazero
  2787. Bra
  2788. CBra 1
  2789. abc
  2790. Ket
  2791. Brazero
  2792. CBra 1
  2793. abc
  2794. Ket
  2795. Ket
  2796. Ket
  2797. Ket
  2798. End
  2799. ------------------------------------------------------------------
  2800. Capture group count = 1
  2801. First code unit = 'a'
  2802. Last code unit = 'c'
  2803. Subject length lower bound = 3
  2804. /a+?+/I
  2805. Failed: error 109 at offset 3: quantifier does not follow a repeatable item
  2806. /a{2,3}?+b/I
  2807. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2808. /(?U)a+?+/I
  2809. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2810. /a{2,3}?+b/I,ungreedy
  2811. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2812. /x(?U)a++b/IB
  2813. ------------------------------------------------------------------
  2814. Bra
  2815. x
  2816. a++
  2817. b
  2818. Ket
  2819. End
  2820. ------------------------------------------------------------------
  2821. Capture group count = 0
  2822. First code unit = 'x'
  2823. Last code unit = 'b'
  2824. Subject length lower bound = 3
  2825. xaaaab
  2826. 0: xaaaab
  2827. /(?U)xa++b/IB
  2828. ------------------------------------------------------------------
  2829. Bra
  2830. x
  2831. a++
  2832. b
  2833. Ket
  2834. End
  2835. ------------------------------------------------------------------
  2836. Capture group count = 0
  2837. First code unit = 'x'
  2838. Last code unit = 'b'
  2839. Subject length lower bound = 3
  2840. xaaaab
  2841. 0: xaaaab
  2842. /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/IB
  2843. ------------------------------------------------------------------
  2844. Bra
  2845. ^
  2846. CBra 1
  2847. CBra 2
  2848. a+
  2849. Ket
  2850. CBra 3
  2851. [ab]+?
  2852. Ket
  2853. CBra 4
  2854. [bc]+
  2855. Ket
  2856. CBra 5
  2857. \w*+
  2858. Ket
  2859. Ket
  2860. Ket
  2861. End
  2862. ------------------------------------------------------------------
  2863. Capture group count = 5
  2864. Compile options: <none>
  2865. Overall options: anchored
  2866. First code unit = 'a'
  2867. Subject length lower bound = 3
  2868. /^x(?U)a+b/IB
  2869. ------------------------------------------------------------------
  2870. Bra
  2871. ^
  2872. x
  2873. a++
  2874. b
  2875. Ket
  2876. End
  2877. ------------------------------------------------------------------
  2878. Capture group count = 0
  2879. Compile options: <none>
  2880. Overall options: anchored
  2881. First code unit = 'x'
  2882. Last code unit = 'b'
  2883. Subject length lower bound = 3
  2884. /^x(?U)(a+)b/IB
  2885. ------------------------------------------------------------------
  2886. Bra
  2887. ^
  2888. x
  2889. CBra 1
  2890. a+?
  2891. Ket
  2892. b
  2893. Ket
  2894. End
  2895. ------------------------------------------------------------------
  2896. Capture group count = 1
  2897. Compile options: <none>
  2898. Overall options: anchored
  2899. First code unit = 'x'
  2900. Last code unit = 'b'
  2901. Subject length lower bound = 3
  2902. /[.x.]/I
  2903. Failed: error 113 at offset 0: POSIX collating elements are not supported
  2904. /[=x=]/I
  2905. Failed: error 113 at offset 0: POSIX collating elements are not supported
  2906. /[:x:]/I
  2907. Failed: error 112 at offset 0: POSIX named classes are supported only within a class
  2908. /\F/I
  2909. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2910. /\l/I
  2911. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2912. /\L/I
  2913. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2914. /\N{name}/I
  2915. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2916. /\u/I
  2917. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2918. /\U/I
  2919. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2920. /\N{4}/
  2921. abcdefg
  2922. 0: abcd
  2923. /\N{,}/
  2924. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2925. /\N{25,ab}/
  2926. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2927. /a{1,3}b/ungreedy
  2928. ab
  2929. 0: ab
  2930. /[/I
  2931. Failed: error 106 at offset 1: missing terminating ] for character class
  2932. /[a-/I
  2933. Failed: error 106 at offset 3: missing terminating ] for character class
  2934. /[[:space:]/I
  2935. Failed: error 106 at offset 10: missing terminating ] for character class
  2936. /[\s]/IB
  2937. ------------------------------------------------------------------
  2938. Bra
  2939. [\x09-\x0d ]
  2940. Ket
  2941. End
  2942. ------------------------------------------------------------------
  2943. Capture group count = 0
  2944. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2945. Subject length lower bound = 1
  2946. /[[:space:]]/IB
  2947. ------------------------------------------------------------------
  2948. Bra
  2949. [\x09-\x0d ]
  2950. Ket
  2951. End
  2952. ------------------------------------------------------------------
  2953. Capture group count = 0
  2954. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2955. Subject length lower bound = 1
  2956. /[[:space:]abcde]/IB
  2957. ------------------------------------------------------------------
  2958. Bra
  2959. [\x09-\x0d a-e]
  2960. Ket
  2961. End
  2962. ------------------------------------------------------------------
  2963. Capture group count = 0
  2964. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b c d e
  2965. Subject length lower bound = 1
  2966. /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
  2967. Capture group count = 0
  2968. Options: extended
  2969. First code unit = '<'
  2970. Last code unit = '>'
  2971. Subject length lower bound = 2
  2972. <>
  2973. 0: <>
  2974. <abcd>
  2975. 0: <abcd>
  2976. <abc <123> hij>
  2977. 0: <abc <123> hij>
  2978. <abc <def> hij>
  2979. 0: <def>
  2980. <abc<>def>
  2981. 0: <abc<>def>
  2982. <abc<>
  2983. 0: <>
  2984. \= Expect no match
  2985. <abc
  2986. No match
  2987. /8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
  2988. ------------------------------------------------------------------
  2989. Bra
  2990. 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
  2991. \b
  2992. Ket
  2993. End
  2994. ------------------------------------------------------------------
  2995. Capture group count = 0
  2996. Max lookbehind = 1
  2997. First code unit = '8'
  2998. Last code unit = 'X'
  2999. Subject length lower bound = 409
  3000. /\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
  3001. ------------------------------------------------------------------
  3002. Bra
  3003. $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
  3004. \b
  3005. Ket
  3006. End
  3007. ------------------------------------------------------------------
  3008. Capture group count = 0
  3009. Max lookbehind = 1
  3010. First code unit = '$'
  3011. Last code unit = 'X'
  3012. Subject length lower bound = 404
  3013. /(.*)\d+\1/I
  3014. Capture group count = 1
  3015. Max back reference = 1
  3016. Subject length lower bound = 1
  3017. /(.*)\d+/I
  3018. Capture group count = 1
  3019. First code unit at start or follows newline
  3020. Subject length lower bound = 1
  3021. /(.*)\d+\1/Is
  3022. Capture group count = 1
  3023. Max back reference = 1
  3024. Options: dotall
  3025. Subject length lower bound = 1
  3026. /(.*)\d+/Is
  3027. Capture group count = 1
  3028. Compile options: dotall
  3029. Overall options: anchored dotall
  3030. Subject length lower bound = 1
  3031. /(.*(xyz))\d+\2/I
  3032. Capture group count = 2
  3033. Max back reference = 2
  3034. First code unit at start or follows newline
  3035. Last code unit = 'z'
  3036. Subject length lower bound = 7
  3037. /((.*))\d+\1/I
  3038. Capture group count = 2
  3039. Max back reference = 1
  3040. Subject length lower bound = 1
  3041. abc123bc
  3042. 0: bc123bc
  3043. 1: bc
  3044. 2: bc
  3045. /a[b]/I
  3046. Capture group count = 0
  3047. First code unit = 'a'
  3048. Last code unit = 'b'
  3049. Subject length lower bound = 2
  3050. /(?=a).*/I
  3051. Capture group count = 0
  3052. May match empty string
  3053. First code unit = 'a'
  3054. Subject length lower bound = 1
  3055. /(?=abc).xyz/Ii
  3056. Capture group count = 0
  3057. Options: caseless
  3058. First code unit = 'a' (caseless)
  3059. Last code unit = 'z' (caseless)
  3060. Subject length lower bound = 4
  3061. /(?=abc)(?i).xyz/I
  3062. Capture group count = 0
  3063. First code unit = 'a'
  3064. Last code unit = 'z' (caseless)
  3065. Subject length lower bound = 4
  3066. /(?=a)(?=b)/I
  3067. Capture group count = 0
  3068. May match empty string
  3069. First code unit = 'a'
  3070. Subject length lower bound = 1
  3071. /(?=.)a/I
  3072. Capture group count = 0
  3073. First code unit = 'a'
  3074. Subject length lower bound = 1
  3075. /((?=abcda)a)/I
  3076. Capture group count = 1
  3077. First code unit = 'a'
  3078. Last code unit = 'a'
  3079. Subject length lower bound = 2
  3080. /((?=abcda)ab)/I
  3081. Capture group count = 1
  3082. First code unit = 'a'
  3083. Last code unit = 'b'
  3084. Subject length lower bound = 2
  3085. /()a/I
  3086. Capture group count = 1
  3087. First code unit = 'a'
  3088. Subject length lower bound = 1
  3089. /(?:(?=.)|(?<!x))a/I
  3090. Capture group count = 0
  3091. Max lookbehind = 1
  3092. First code unit = 'a'
  3093. Subject length lower bound = 1
  3094. /(?(1)ab|ac)(.)/I
  3095. Capture group count = 1
  3096. Max back reference = 1
  3097. First code unit = 'a'
  3098. Subject length lower bound = 3
  3099. /(?(1)abz|acz)(.)/I
  3100. Capture group count = 1
  3101. Max back reference = 1
  3102. First code unit = 'a'
  3103. Last code unit = 'z'
  3104. Subject length lower bound = 4
  3105. /(?(1)abz)(.)/I
  3106. Capture group count = 1
  3107. Max back reference = 1
  3108. Subject length lower bound = 1
  3109. /(?(1)abz)(1)23/I
  3110. Capture group count = 1
  3111. Max back reference = 1
  3112. Last code unit = '3'
  3113. Subject length lower bound = 3
  3114. /(a)+/I
  3115. Capture group count = 1
  3116. First code unit = 'a'
  3117. Subject length lower bound = 1
  3118. /(a){2,3}/I
  3119. Capture group count = 1
  3120. First code unit = 'a'
  3121. Last code unit = 'a'
  3122. Subject length lower bound = 2
  3123. /(a)*/I
  3124. Capture group count = 1
  3125. May match empty string
  3126. Subject length lower bound = 0
  3127. /[a]/I
  3128. Capture group count = 0
  3129. First code unit = 'a'
  3130. Subject length lower bound = 1
  3131. /[ab]/I
  3132. Capture group count = 0
  3133. Starting code units: a b
  3134. Subject length lower bound = 1
  3135. /[ab]/I
  3136. Capture group count = 0
  3137. Starting code units: a b
  3138. Subject length lower bound = 1
  3139. /[^a]/I
  3140. Capture group count = 0
  3141. Subject length lower bound = 1
  3142. /\d456/I
  3143. Capture group count = 0
  3144. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3145. Last code unit = '6'
  3146. Subject length lower bound = 4
  3147. /\d456/I
  3148. Capture group count = 0
  3149. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3150. Last code unit = '6'
  3151. Subject length lower bound = 4
  3152. /a^b/I
  3153. Capture group count = 0
  3154. First code unit = 'a'
  3155. Last code unit = 'b'
  3156. Subject length lower bound = 2
  3157. /^a/Im
  3158. Capture group count = 0
  3159. Options: multiline
  3160. First code unit at start or follows newline
  3161. Last code unit = 'a'
  3162. Subject length lower bound = 1
  3163. abcde
  3164. 0: a
  3165. xy\nabc
  3166. 0: a
  3167. \= Expect no match
  3168. xyabc
  3169. No match
  3170. /c|abc/I
  3171. Capture group count = 0
  3172. Starting code units: a c
  3173. Last code unit = 'c'
  3174. Subject length lower bound = 1
  3175. /(?i)[ab]/I
  3176. Capture group count = 0
  3177. Starting code units: A B a b
  3178. Subject length lower bound = 1
  3179. /[ab](?i)cd/I
  3180. Capture group count = 0
  3181. Starting code units: a b
  3182. Last code unit = 'd' (caseless)
  3183. Subject length lower bound = 3
  3184. /abc(?C)def/I
  3185. Capture group count = 0
  3186. First code unit = 'a'
  3187. Last code unit = 'f'
  3188. Subject length lower bound = 6
  3189. abcdef
  3190. --->abcdef
  3191. 0 ^ ^ d
  3192. 0: abcdef
  3193. 1234abcdef
  3194. --->1234abcdef
  3195. 0 ^ ^ d
  3196. 0: abcdef
  3197. \= Expect no match
  3198. abcxyz
  3199. No match
  3200. abcxyzf
  3201. --->abcxyzf
  3202. 0 ^ ^ d
  3203. No match
  3204. /abc(?C)de(?C1)f/I
  3205. Capture group count = 0
  3206. First code unit = 'a'
  3207. Last code unit = 'f'
  3208. Subject length lower bound = 6
  3209. 123abcdef
  3210. --->123abcdef
  3211. 0 ^ ^ d
  3212. 1 ^ ^ f
  3213. 0: abcdef
  3214. /(?C1)\dabc(?C2)def/I
  3215. Capture group count = 0
  3216. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3217. Last code unit = 'f'
  3218. Subject length lower bound = 7
  3219. 1234abcdef
  3220. --->1234abcdef
  3221. 1 ^ \d
  3222. 1 ^ \d
  3223. 1 ^ \d
  3224. 1 ^ \d
  3225. 2 ^ ^ d
  3226. 0: 4abcdef
  3227. \= Expect no match
  3228. abcdef
  3229. No match
  3230. /(?C1)\dabc(?C2)def/I
  3231. Capture group count = 0
  3232. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3233. Last code unit = 'f'
  3234. Subject length lower bound = 7
  3235. 1234abcdef
  3236. --->1234abcdef
  3237. 1 ^ \d
  3238. 1 ^ \d
  3239. 1 ^ \d
  3240. 1 ^ \d
  3241. 2 ^ ^ d
  3242. 0: 4abcdef
  3243. \= Expect no match
  3244. abcdef
  3245. No match
  3246. /(?C255)ab/I
  3247. Capture group count = 0
  3248. First code unit = 'a'
  3249. Last code unit = 'b'
  3250. Subject length lower bound = 2
  3251. /(?C256)ab/I
  3252. Failed: error 138 at offset 6: number after (?C is greater than 255
  3253. /(?Cab)xx/I
  3254. Failed: error 182 at offset 3: unrecognized string delimiter follows (?C
  3255. /(?C12vr)x/I
  3256. Failed: error 139 at offset 5: closing parenthesis for (?C expected
  3257. /abc(?C)def/I
  3258. Capture group count = 0
  3259. First code unit = 'a'
  3260. Last code unit = 'f'
  3261. Subject length lower bound = 6
  3262. \x83\x0\x61bcdef
  3263. --->\x83\x00abcdef
  3264. 0 ^ ^ d
  3265. 0: abcdef
  3266. /(abc)(?C)de(?C1)f/I
  3267. Capture group count = 1
  3268. First code unit = 'a'
  3269. Last code unit = 'f'
  3270. Subject length lower bound = 6
  3271. 123abcdef
  3272. --->123abcdef
  3273. 0 ^ ^ d
  3274. 1 ^ ^ f
  3275. 0: abcdef
  3276. 1: abc
  3277. 123abcdef\=callout_capture
  3278. Callout 0: last capture = 1
  3279. 1: abc
  3280. --->123abcdef
  3281. ^ ^ d
  3282. Callout 1: last capture = 1
  3283. 1: abc
  3284. --->123abcdef
  3285. ^ ^ f
  3286. 0: abcdef
  3287. 1: abc
  3288. 123abcdefC-\=callout_none
  3289. 0: abcdef
  3290. 1: abc
  3291. \= Expect no match
  3292. 123abcdef\=callout_fail=1
  3293. --->123abcdef
  3294. 0 ^ ^ d
  3295. 1 ^ ^ f
  3296. No match
  3297. /(?C0)(abc(?C1))*/I
  3298. Capture group count = 1
  3299. May match empty string
  3300. Subject length lower bound = 0
  3301. abcabcabc
  3302. --->abcabcabc
  3303. 0 ^ (
  3304. 1 ^ ^ )*
  3305. 1 ^ ^ )*
  3306. 1 ^ ^ )*
  3307. 0: abcabcabc
  3308. 1: abc
  3309. abcabc\=callout_fail=1:4
  3310. --->abcabc
  3311. 0 ^ (
  3312. 1 ^ ^ )*
  3313. 1 ^ ^ )*
  3314. 0: abcabc
  3315. 1: abc
  3316. abcabcabc\=callout_fail=1:4
  3317. --->abcabcabc
  3318. 0 ^ (
  3319. 1 ^ ^ )*
  3320. 1 ^ ^ )*
  3321. 1 ^ ^ )*
  3322. 0: abcabc
  3323. 1: abc
  3324. /(\d{3}(?C))*/I
  3325. Capture group count = 1
  3326. May match empty string
  3327. Subject length lower bound = 0
  3328. 123\=callout_capture
  3329. Callout 0: last capture = 0
  3330. --->123
  3331. ^ ^ )*
  3332. 0: 123
  3333. 1: 123
  3334. 123456\=callout_capture
  3335. Callout 0: last capture = 0
  3336. --->123456
  3337. ^ ^ )*
  3338. Callout 0: last capture = 1
  3339. 1: 123
  3340. --->123456
  3341. ^ ^ )*
  3342. 0: 123456
  3343. 1: 456
  3344. 123456789\=callout_capture
  3345. Callout 0: last capture = 0
  3346. --->123456789
  3347. ^ ^ )*
  3348. Callout 0: last capture = 1
  3349. 1: 123
  3350. --->123456789
  3351. ^ ^ )*
  3352. Callout 0: last capture = 1
  3353. 1: 456
  3354. --->123456789
  3355. ^ ^ )*
  3356. 0: 123456789
  3357. 1: 789
  3358. /((xyz)(?C)p|(?C1)xyzabc)/I
  3359. Capture group count = 2
  3360. First code unit = 'x'
  3361. Subject length lower bound = 4
  3362. xyzabc\=callout_capture
  3363. Callout 0: last capture = 2
  3364. 1: <unset>
  3365. 2: xyz
  3366. --->xyzabc
  3367. ^ ^ p
  3368. Callout 1: last capture = 0
  3369. --->xyzabc
  3370. ^ x
  3371. 0: xyzabc
  3372. 1: xyzabc
  3373. /(X)((xyz)(?C)p|(?C1)xyzabc)/I
  3374. Capture group count = 3
  3375. First code unit = 'X'
  3376. Last code unit = 'x'
  3377. Subject length lower bound = 5
  3378. Xxyzabc\=callout_capture
  3379. Callout 0: last capture = 3
  3380. 1: X
  3381. 2: <unset>
  3382. 3: xyz
  3383. --->Xxyzabc
  3384. ^ ^ p
  3385. Callout 1: last capture = 1
  3386. 1: X
  3387. --->Xxyzabc
  3388. ^^ x
  3389. 0: Xxyzabc
  3390. 1: X
  3391. 2: xyzabc
  3392. /(?=(abc))(?C)abcdef/I
  3393. Capture group count = 1
  3394. First code unit = 'a'
  3395. Last code unit = 'f'
  3396. Subject length lower bound = 6
  3397. abcdef\=callout_capture
  3398. Callout 0: last capture = 1
  3399. 1: abc
  3400. --->abcdef
  3401. ^ a
  3402. 0: abcdef
  3403. 1: abc
  3404. /(?!(abc)(?C1)d)(?C2)abcxyz/I
  3405. Capture group count = 1
  3406. First code unit = 'a'
  3407. Last code unit = 'z'
  3408. Subject length lower bound = 6
  3409. abcxyz\=callout_capture
  3410. Callout 1: last capture = 1
  3411. 1: abc
  3412. --->abcxyz
  3413. ^ ^ d
  3414. Callout 2: last capture = 0
  3415. --->abcxyz
  3416. ^ a
  3417. 0: abcxyz
  3418. /(?<=(abc)(?C))xyz/I
  3419. Capture group count = 1
  3420. Max lookbehind = 3
  3421. First code unit = 'x'
  3422. Last code unit = 'z'
  3423. Subject length lower bound = 3
  3424. abcxyz\=callout_capture
  3425. Callout 0: last capture = 1
  3426. 1: abc
  3427. --->abcxyz
  3428. ^ )
  3429. 0: xyz
  3430. 1: abc
  3431. /a(b+)(c*)(?C1)/I
  3432. Capture group count = 2
  3433. First code unit = 'a'
  3434. Last code unit = 'b'
  3435. Subject length lower bound = 2
  3436. \= Expect no match
  3437. abbbbbccc\=callout_data=1
  3438. --->abbbbbccc
  3439. 1 ^ ^ End of pattern
  3440. Callout data = 1
  3441. No match
  3442. /a(b+?)(c*?)(?C1)/I
  3443. Capture group count = 2
  3444. First code unit = 'a'
  3445. Last code unit = 'b'
  3446. Subject length lower bound = 2
  3447. \= Expect no match
  3448. abbbbbccc\=callout_data=1
  3449. --->abbbbbccc
  3450. 1 ^ ^ End of pattern
  3451. Callout data = 1
  3452. 1 ^ ^ End of pattern
  3453. Callout data = 1
  3454. 1 ^ ^ End of pattern
  3455. Callout data = 1
  3456. 1 ^ ^ End of pattern
  3457. Callout data = 1
  3458. 1 ^ ^ End of pattern
  3459. Callout data = 1
  3460. 1 ^ ^ End of pattern
  3461. Callout data = 1
  3462. 1 ^ ^ End of pattern
  3463. Callout data = 1
  3464. 1 ^ ^ End of pattern
  3465. Callout data = 1
  3466. No match
  3467. /(?C)abc/I
  3468. Capture group count = 0
  3469. First code unit = 'a'
  3470. Last code unit = 'c'
  3471. Subject length lower bound = 3
  3472. /(?C)^abc/I
  3473. Capture group count = 0
  3474. Compile options: <none>
  3475. Overall options: anchored
  3476. First code unit = 'a'
  3477. Subject length lower bound = 3
  3478. /(?C)a|b/I
  3479. Capture group count = 0
  3480. Starting code units: a b
  3481. Subject length lower bound = 1
  3482. /a|(b)(?C)/I
  3483. Capture group count = 1
  3484. Starting code units: a b
  3485. Subject length lower bound = 1
  3486. b
  3487. --->b
  3488. 0 ^^ End of pattern
  3489. 0: b
  3490. 1: b
  3491. /x(ab|(bc|(de|(?R))))/I
  3492. Capture group count = 3
  3493. First code unit = 'x'
  3494. Subject length lower bound = 3
  3495. xab
  3496. 0: xab
  3497. 1: ab
  3498. xbc
  3499. 0: xbc
  3500. 1: bc
  3501. 2: bc
  3502. xde
  3503. 0: xde
  3504. 1: de
  3505. 2: de
  3506. 3: de
  3507. xxab
  3508. 0: xxab
  3509. 1: xab
  3510. 2: xab
  3511. 3: xab
  3512. xxxab
  3513. 0: xxxab
  3514. 1: xxab
  3515. 2: xxab
  3516. 3: xxab
  3517. \= Expect no match
  3518. xyab
  3519. No match
  3520. /^([^()]|\((?1)*\))*$/I
  3521. Capture group count = 1
  3522. May match empty string
  3523. Compile options: <none>
  3524. Overall options: anchored
  3525. Subject length lower bound = 0
  3526. abc
  3527. 0: abc
  3528. 1: c
  3529. a(b)c
  3530. 0: a(b)c
  3531. 1: c
  3532. a(b(c))d
  3533. 0: a(b(c))d
  3534. 1: d
  3535. \= Expect no match)
  3536. a(b(c)d
  3537. No match
  3538. /^>abc>([^()]|\((?1)*\))*<xyz<$/I
  3539. Capture group count = 1
  3540. Compile options: <none>
  3541. Overall options: anchored
  3542. First code unit = '>'
  3543. Last code unit = '<'
  3544. Subject length lower bound = 10
  3545. >abc>123<xyz<
  3546. 0: >abc>123<xyz<
  3547. 1: 3
  3548. >abc>1(2)3<xyz<
  3549. 0: >abc>1(2)3<xyz<
  3550. 1: 3
  3551. >abc>(1(2)3)<xyz<
  3552. 0: >abc>(1(2)3)<xyz<
  3553. 1: (1(2)3)
  3554. /(a(?1)b)/IB
  3555. ------------------------------------------------------------------
  3556. Bra
  3557. CBra 1
  3558. a
  3559. Recurse
  3560. b
  3561. Ket
  3562. Ket
  3563. End
  3564. ------------------------------------------------------------------
  3565. Capture group count = 1
  3566. First code unit = 'a'
  3567. Last code unit = 'b'
  3568. Subject length lower bound = 2
  3569. /(a(?1)+b)/IB
  3570. ------------------------------------------------------------------
  3571. Bra
  3572. CBra 1
  3573. a
  3574. SBra
  3575. Recurse
  3576. KetRmax
  3577. b
  3578. Ket
  3579. Ket
  3580. End
  3581. ------------------------------------------------------------------
  3582. Capture group count = 1
  3583. First code unit = 'a'
  3584. Last code unit = 'b'
  3585. Subject length lower bound = 2
  3586. /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
  3587. Capture group count = 2
  3588. Compile options: <none>
  3589. Overall options: anchored
  3590. Starting code units: ( - 0 1 2 3 4 5 6 7 8 9
  3591. Subject length lower bound = 1
  3592. 12
  3593. 0: 12
  3594. 1: 12
  3595. (((2+2)*-3)-7)
  3596. 0: (((2+2)*-3)-7)
  3597. 1: (((2+2)*-3)-7)
  3598. 2: -
  3599. -12
  3600. 0: -12
  3601. 1: -12
  3602. \= Expect no match
  3603. ((2+2)*-3)-7)
  3604. No match
  3605. /^(x(y|(?1){2})z)/I
  3606. Capture group count = 2
  3607. Compile options: <none>
  3608. Overall options: anchored
  3609. First code unit = 'x'
  3610. Subject length lower bound = 3
  3611. xyz
  3612. 0: xyz
  3613. 1: xyz
  3614. 2: y
  3615. xxyzxyzz
  3616. 0: xxyzxyzz
  3617. 1: xxyzxyzz
  3618. 2: xyzxyz
  3619. \= Expect no match
  3620. xxyzz
  3621. No match
  3622. xxyzxyzxyzz
  3623. No match
  3624. /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
  3625. Capture group count = 2
  3626. Options: extended
  3627. First code unit = '<'
  3628. Last code unit = '>'
  3629. Subject length lower bound = 2
  3630. <>
  3631. 0: <>
  3632. 1: <>
  3633. 2: <>
  3634. <abcd>
  3635. 0: <abcd>
  3636. 1: <abcd>
  3637. 2: <abcd>
  3638. <abc <123> hij>
  3639. 0: <abc <123> hij>
  3640. 1: <abc <123> hij>
  3641. 2: <abc <123> hij>
  3642. <abc <def> hij>
  3643. 0: <def>
  3644. 1: <def>
  3645. 2: <def>
  3646. <abc<>def>
  3647. 0: <abc<>def>
  3648. 1: <abc<>def>
  3649. 2: <abc<>def>
  3650. <abc<>
  3651. 0: <>
  3652. 1: <>
  3653. 2: <>
  3654. \= Expect no match
  3655. <abc
  3656. No match
  3657. /(?1)/I
  3658. Failed: error 115 at offset 3: reference to non-existent subpattern
  3659. /((?2)(abc)/I
  3660. Failed: error 114 at offset 10: missing closing parenthesis
  3661. /^(abc)def(?1)/I
  3662. Capture group count = 1
  3663. Compile options: <none>
  3664. Overall options: anchored
  3665. First code unit = 'a'
  3666. Subject length lower bound = 9
  3667. abcdefabc
  3668. 0: abcdefabc
  3669. 1: abc
  3670. /^(a|b|c)=(?1)+/I
  3671. Capture group count = 1
  3672. Compile options: <none>
  3673. Overall options: anchored
  3674. Starting code units: a b c
  3675. Subject length lower bound = 2
  3676. a=a
  3677. 0: a=a
  3678. 1: a
  3679. a=b
  3680. 0: a=b
  3681. 1: a
  3682. a=bc
  3683. 0: a=bc
  3684. 1: a
  3685. /^(a|b|c)=((?1))+/I
  3686. Capture group count = 2
  3687. Compile options: <none>
  3688. Overall options: anchored
  3689. Starting code units: a b c
  3690. Subject length lower bound = 2
  3691. a=a
  3692. 0: a=a
  3693. 1: a
  3694. 2: a
  3695. a=b
  3696. 0: a=b
  3697. 1: a
  3698. 2: b
  3699. a=bc
  3700. 0: a=bc
  3701. 1: a
  3702. 2: c
  3703. /a(?P<name1>b|c)d(?P<longername2>e)/IB
  3704. ------------------------------------------------------------------
  3705. Bra
  3706. a
  3707. CBra 1
  3708. b
  3709. Alt
  3710. c
  3711. Ket
  3712. d
  3713. CBra 2
  3714. e
  3715. Ket
  3716. Ket
  3717. End
  3718. ------------------------------------------------------------------
  3719. Capture group count = 2
  3720. Named capture groups:
  3721. longername2 2
  3722. name1 1
  3723. First code unit = 'a'
  3724. Last code unit = 'e'
  3725. Subject length lower bound = 4
  3726. abde
  3727. 0: abde
  3728. 1: b
  3729. 2: e
  3730. acde
  3731. 0: acde
  3732. 1: c
  3733. 2: e
  3734. /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/IB
  3735. ------------------------------------------------------------------
  3736. Bra
  3737. Bra
  3738. a
  3739. CBra 1
  3740. c
  3741. CBra 2
  3742. d
  3743. Ket
  3744. Ket
  3745. Ket
  3746. CBra 3
  3747. a
  3748. Ket
  3749. Ket
  3750. End
  3751. ------------------------------------------------------------------
  3752. Capture group count = 3
  3753. Named capture groups:
  3754. a 3
  3755. c 1
  3756. d 2
  3757. First code unit = 'a'
  3758. Last code unit = 'a'
  3759. Subject length lower bound = 4
  3760. /(?P<a>a)...(?P=a)bbb(?P>a)d/IB
  3761. ------------------------------------------------------------------
  3762. Bra
  3763. CBra 1
  3764. a
  3765. Ket
  3766. Any
  3767. Any
  3768. Any
  3769. \1
  3770. bbb
  3771. Recurse
  3772. d
  3773. Ket
  3774. End
  3775. ------------------------------------------------------------------
  3776. Capture group count = 1
  3777. Max back reference = 1
  3778. Named capture groups:
  3779. a 1
  3780. First code unit = 'a'
  3781. Last code unit = 'd'
  3782. Subject length lower bound = 10
  3783. /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
  3784. Capture group count = 4
  3785. Max back reference = 4
  3786. Named capture groups:
  3787. four 4
  3788. one 1
  3789. three 3
  3790. two 2
  3791. May match empty string
  3792. Compile options: caseless
  3793. Overall options: anchored caseless
  3794. Subject length lower bound = 0
  3795. 1221
  3796. 0: 1221
  3797. 1: 1221
  3798. 2: 1
  3799. Satan, oscillate my metallic sonatas!
  3800. 0: Satan, oscillate my metallic sonatas!
  3801. 1: <unset>
  3802. 2: <unset>
  3803. 3: Satan, oscillate my metallic sonatas
  3804. 4: S
  3805. A man, a plan, a canal: Panama!
  3806. 0: A man, a plan, a canal: Panama!
  3807. 1: <unset>
  3808. 2: <unset>
  3809. 3: A man, a plan, a canal: Panama
  3810. 4: A
  3811. Able was I ere I saw Elba.
  3812. 0: Able was I ere I saw Elba.
  3813. 1: <unset>
  3814. 2: <unset>
  3815. 3: Able was I ere I saw Elba
  3816. 4: A
  3817. \= Expect no match
  3818. The quick brown fox
  3819. No match
  3820. /((?(R)a|b))\1(?1)?/I
  3821. Capture group count = 1
  3822. Max back reference = 1
  3823. Subject length lower bound = 2
  3824. bb
  3825. 0: bb
  3826. 1: b
  3827. bbaa
  3828. 0: bba
  3829. 1: b
  3830. /(.*)a/Is
  3831. Capture group count = 1
  3832. Compile options: dotall
  3833. Overall options: anchored dotall
  3834. Last code unit = 'a'
  3835. Subject length lower bound = 1
  3836. /(.*)a\1/Is
  3837. Capture group count = 1
  3838. Max back reference = 1
  3839. Options: dotall
  3840. Last code unit = 'a'
  3841. Subject length lower bound = 1
  3842. /(.*)a(b)\2/Is
  3843. Capture group count = 2
  3844. Max back reference = 2
  3845. Compile options: dotall
  3846. Overall options: anchored dotall
  3847. Last code unit = 'b'
  3848. Subject length lower bound = 3
  3849. /((.*)a|(.*)b)z/Is
  3850. Capture group count = 3
  3851. Compile options: dotall
  3852. Overall options: anchored dotall
  3853. Last code unit = 'z'
  3854. Subject length lower bound = 2
  3855. /((.*)a|(.*)b)z\1/Is
  3856. Capture group count = 3
  3857. Max back reference = 1
  3858. Options: dotall
  3859. Last code unit = 'z'
  3860. Subject length lower bound = 3
  3861. /((.*)a|(.*)b)z\2/Is
  3862. Capture group count = 3
  3863. Max back reference = 2
  3864. Options: dotall
  3865. Last code unit = 'z'
  3866. Subject length lower bound = 2
  3867. /((.*)a|(.*)b)z\3/Is
  3868. Capture group count = 3
  3869. Max back reference = 3
  3870. Options: dotall
  3871. Last code unit = 'z'
  3872. Subject length lower bound = 2
  3873. /((.*)a|^(.*)b)z\3/Is
  3874. Capture group count = 3
  3875. Max back reference = 3
  3876. Compile options: dotall
  3877. Overall options: anchored dotall
  3878. Last code unit = 'z'
  3879. Subject length lower bound = 2
  3880. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
  3881. Capture group count = 31
  3882. May match empty string
  3883. Compile options: dotall
  3884. Overall options: anchored dotall
  3885. Subject length lower bound = 0
  3886. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
  3887. Capture group count = 31
  3888. Max back reference = 31
  3889. May match empty string
  3890. Options: dotall
  3891. Subject length lower bound = 0
  3892. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
  3893. Capture group count = 32
  3894. Max back reference = 32
  3895. May match empty string
  3896. Options: dotall
  3897. Subject length lower bound = 0
  3898. /(a)(bc)/IB,no_auto_capture
  3899. ------------------------------------------------------------------
  3900. Bra
  3901. Bra
  3902. a
  3903. Ket
  3904. Bra
  3905. bc
  3906. Ket
  3907. Ket
  3908. End
  3909. ------------------------------------------------------------------
  3910. Capture group count = 0
  3911. Options: no_auto_capture
  3912. First code unit = 'a'
  3913. Last code unit = 'c'
  3914. Subject length lower bound = 3
  3915. abc
  3916. 0: abc
  3917. /(?P<one>a)(bc)/IB,no_auto_capture
  3918. ------------------------------------------------------------------
  3919. Bra
  3920. CBra 1
  3921. a
  3922. Ket
  3923. Bra
  3924. bc
  3925. Ket
  3926. Ket
  3927. End
  3928. ------------------------------------------------------------------
  3929. Capture group count = 1
  3930. Named capture groups:
  3931. one 1
  3932. Options: no_auto_capture
  3933. First code unit = 'a'
  3934. Last code unit = 'c'
  3935. Subject length lower bound = 3
  3936. abc
  3937. 0: abc
  3938. 1: a
  3939. /(a)(?P<named>bc)/IB,no_auto_capture
  3940. ------------------------------------------------------------------
  3941. Bra
  3942. Bra
  3943. a
  3944. Ket
  3945. CBra 1
  3946. bc
  3947. Ket
  3948. Ket
  3949. End
  3950. ------------------------------------------------------------------
  3951. Capture group count = 1
  3952. Named capture groups:
  3953. named 1
  3954. Options: no_auto_capture
  3955. First code unit = 'a'
  3956. Last code unit = 'c'
  3957. Subject length lower bound = 3
  3958. /(aaa(?C1)bbb|ab)/I
  3959. Capture group count = 1
  3960. First code unit = 'a'
  3961. Last code unit = 'b'
  3962. Subject length lower bound = 2
  3963. aaabbb
  3964. --->aaabbb
  3965. 1 ^ ^ b
  3966. 0: aaabbb
  3967. 1: aaabbb
  3968. aaabbb\=callout_data=0
  3969. --->aaabbb
  3970. 1 ^ ^ b
  3971. 0: aaabbb
  3972. 1: aaabbb
  3973. aaabbb\=callout_data=1
  3974. --->aaabbb
  3975. 1 ^ ^ b
  3976. Callout data = 1
  3977. 0: ab
  3978. 1: ab
  3979. \= Expect no match
  3980. aaabbb\=callout_data=-1
  3981. --->aaabbb
  3982. 1 ^ ^ b
  3983. Callout data = -1
  3984. No match
  3985. /ab(?P<one>cd)ef(?P<two>gh)/I
  3986. Capture group count = 2
  3987. Named capture groups:
  3988. one 1
  3989. two 2
  3990. First code unit = 'a'
  3991. Last code unit = 'h'
  3992. Subject length lower bound = 8
  3993. abcdefgh
  3994. 0: abcdefgh
  3995. 1: cd
  3996. 2: gh
  3997. abcdefgh\=copy=1,get=two
  3998. 0: abcdefgh
  3999. 1: cd
  4000. 2: gh
  4001. 1C cd (2)
  4002. G gh (2) two (group 2)
  4003. abcdefgh\=copy=one,copy=two
  4004. 0: abcdefgh
  4005. 1: cd
  4006. 2: gh
  4007. C cd (2) one (group 1)
  4008. C gh (2) two (group 2)
  4009. abcdefgh\=copy=three
  4010. 0: abcdefgh
  4011. 1: cd
  4012. 2: gh
  4013. Number not found for group 'three'
  4014. Copy substring 'three' failed (-49): unknown substring
  4015. /(?P<Tes>)(?P<Test>)/IB
  4016. ------------------------------------------------------------------
  4017. Bra
  4018. CBra 1
  4019. Ket
  4020. CBra 2
  4021. Ket
  4022. Ket
  4023. End
  4024. ------------------------------------------------------------------
  4025. Capture group count = 2
  4026. Named capture groups:
  4027. Tes 1
  4028. Test 2
  4029. May match empty string
  4030. Subject length lower bound = 0
  4031. /(?P<Test>)(?P<Tes>)/IB
  4032. ------------------------------------------------------------------
  4033. Bra
  4034. CBra 1
  4035. Ket
  4036. CBra 2
  4037. Ket
  4038. Ket
  4039. End
  4040. ------------------------------------------------------------------
  4041. Capture group count = 2
  4042. Named capture groups:
  4043. Tes 2
  4044. Test 1
  4045. May match empty string
  4046. Subject length lower bound = 0
  4047. /(?P<Z>zz)(?P<A>aa)/I
  4048. Capture group count = 2
  4049. Named capture groups:
  4050. A 2
  4051. Z 1
  4052. First code unit = 'z'
  4053. Last code unit = 'a'
  4054. Subject length lower bound = 4
  4055. zzaa\=copy=Z
  4056. 0: zzaa
  4057. 1: zz
  4058. 2: aa
  4059. C zz (2) Z (group 1)
  4060. zzaa\=copy=A
  4061. 0: zzaa
  4062. 1: zz
  4063. 2: aa
  4064. C aa (2) A (group 2)
  4065. /(?P<x>eks)(?P<x>eccs)/I
  4066. Failed: error 143 at offset 16: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  4067. /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
  4068. Failed: error 143 at offset 31: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  4069. "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
  4070. Capture group count = 3
  4071. Named capture groups:
  4072. elem 2
  4073. First code unit = '['
  4074. Last code unit = ']'
  4075. Subject length lower bound = 3
  4076. [10,20,30,5,5,4,4,2,43,23,4234]
  4077. 0: [10,20,30,5,5,4,4,2,43,23,4234]
  4078. 1: 10,20,30,5,5,4,4,2,43,23,4234
  4079. 2: 10
  4080. 3: ,4234
  4081. \= Expect no match
  4082. []
  4083. No match
  4084. "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
  4085. Capture group count = 3
  4086. Named capture groups:
  4087. elem 2
  4088. First code unit = '['
  4089. Last code unit = ']'
  4090. Subject length lower bound = 2
  4091. [10,20,30,5,5,4,4,2,43,23,4234]
  4092. 0: [10,20,30,5,5,4,4,2,43,23,4234]
  4093. 1: 10,20,30,5,5,4,4,2,43,23,4234
  4094. 2: 10
  4095. 3: ,4234
  4096. []
  4097. 0: []
  4098. /(a(b(?2)c))?/IB
  4099. ------------------------------------------------------------------
  4100. Bra
  4101. Brazero
  4102. CBra 1
  4103. a
  4104. CBra 2
  4105. b
  4106. Recurse
  4107. c
  4108. Ket
  4109. Ket
  4110. Ket
  4111. End
  4112. ------------------------------------------------------------------
  4113. Capture group count = 2
  4114. May match empty string
  4115. Subject length lower bound = 0
  4116. /(a(b(?2)c))*/IB
  4117. ------------------------------------------------------------------
  4118. Bra
  4119. Brazero
  4120. CBra 1
  4121. a
  4122. CBra 2
  4123. b
  4124. Recurse
  4125. c
  4126. Ket
  4127. KetRmax
  4128. Ket
  4129. End
  4130. ------------------------------------------------------------------
  4131. Capture group count = 2
  4132. May match empty string
  4133. Subject length lower bound = 0
  4134. /(a(b(?2)c)){0,2}/IB
  4135. ------------------------------------------------------------------
  4136. Bra
  4137. Brazero
  4138. Bra
  4139. CBra 1
  4140. a
  4141. CBra 2
  4142. b
  4143. Recurse
  4144. c
  4145. Ket
  4146. Ket
  4147. Brazero
  4148. CBra 1
  4149. a
  4150. CBra 2
  4151. b
  4152. Recurse
  4153. c
  4154. Ket
  4155. Ket
  4156. Ket
  4157. Ket
  4158. End
  4159. ------------------------------------------------------------------
  4160. Capture group count = 2
  4161. May match empty string
  4162. Subject length lower bound = 0
  4163. /[ab]{1}+/B
  4164. ------------------------------------------------------------------
  4165. Bra
  4166. [ab]
  4167. Ket
  4168. End
  4169. ------------------------------------------------------------------
  4170. /()(?1){1}/B
  4171. ------------------------------------------------------------------
  4172. Bra
  4173. CBra 1
  4174. Ket
  4175. Recurse
  4176. Ket
  4177. End
  4178. ------------------------------------------------------------------
  4179. /()(?1)/B
  4180. ------------------------------------------------------------------
  4181. Bra
  4182. CBra 1
  4183. Ket
  4184. Recurse
  4185. Ket
  4186. End
  4187. ------------------------------------------------------------------
  4188. /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
  4189. Capture group count = 3
  4190. Options: caseless
  4191. Last code unit = 'g' (caseless)
  4192. Subject length lower bound = 8
  4193. Baby Bjorn Active Carrier - With free SHIPPING!!
  4194. 0: Baby Bjorn Active Carrier - With free SHIPPING!!
  4195. 1: Baby Bjorn Active Carrier - With free SHIPPING!!
  4196. /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
  4197. Capture group count = 3
  4198. Options: caseless
  4199. Last code unit = 'g' (caseless)
  4200. Subject length lower bound = 8
  4201. Baby Bjorn Active Carrier - With free SHIPPING!!
  4202. 0: Baby Bjorn Active Carrier - With free SHIPPING!!
  4203. 1: Baby Bjorn Active Carrier - With free SHIPPING!!
  4204. /a*.*b/IB
  4205. ------------------------------------------------------------------
  4206. Bra
  4207. a*
  4208. Any*
  4209. b
  4210. Ket
  4211. End
  4212. ------------------------------------------------------------------
  4213. Capture group count = 0
  4214. Last code unit = 'b'
  4215. Subject length lower bound = 1
  4216. /(a|b)*.?c/IB
  4217. ------------------------------------------------------------------
  4218. Bra
  4219. Brazero
  4220. CBra 1
  4221. a
  4222. Alt
  4223. b
  4224. KetRmax
  4225. Any?
  4226. c
  4227. Ket
  4228. End
  4229. ------------------------------------------------------------------
  4230. Capture group count = 1
  4231. Last code unit = 'c'
  4232. Subject length lower bound = 1
  4233. /abc(?C255)de(?C)f/IB
  4234. ------------------------------------------------------------------
  4235. Bra
  4236. abc
  4237. Callout 255 10 1
  4238. de
  4239. Callout 0 16 1
  4240. f
  4241. Ket
  4242. End
  4243. ------------------------------------------------------------------
  4244. Capture group count = 0
  4245. First code unit = 'a'
  4246. Last code unit = 'f'
  4247. Subject length lower bound = 6
  4248. /abcde/IB,auto_callout
  4249. ------------------------------------------------------------------
  4250. Bra
  4251. Callout 255 0 1
  4252. a
  4253. Callout 255 1 1
  4254. b
  4255. Callout 255 2 1
  4256. c
  4257. Callout 255 3 1
  4258. d
  4259. Callout 255 4 1
  4260. e
  4261. Callout 255 5 0
  4262. Ket
  4263. End
  4264. ------------------------------------------------------------------
  4265. Capture group count = 0
  4266. Options: auto_callout
  4267. First code unit = 'a'
  4268. Last code unit = 'e'
  4269. Subject length lower bound = 5
  4270. abcde
  4271. --->abcde
  4272. +0 ^ a
  4273. +1 ^^ b
  4274. +2 ^ ^ c
  4275. +3 ^ ^ d
  4276. +4 ^ ^ e
  4277. +5 ^ ^ End of pattern
  4278. 0: abcde
  4279. \= Expect no match
  4280. abcdfe
  4281. --->abcdfe
  4282. +0 ^ a
  4283. +1 ^^ b
  4284. +2 ^ ^ c
  4285. +3 ^ ^ d
  4286. +4 ^ ^ e
  4287. No match
  4288. /a*b/IB,auto_callout
  4289. ------------------------------------------------------------------
  4290. Bra
  4291. Callout 255 0 2
  4292. a*+
  4293. Callout 255 2 1
  4294. b
  4295. Callout 255 3 0
  4296. Ket
  4297. End
  4298. ------------------------------------------------------------------
  4299. Capture group count = 0
  4300. Options: auto_callout
  4301. Starting code units: a b
  4302. Last code unit = 'b'
  4303. Subject length lower bound = 1
  4304. ab
  4305. --->ab
  4306. +0 ^ a*
  4307. +2 ^^ b
  4308. +3 ^ ^ End of pattern
  4309. 0: ab
  4310. aaaab
  4311. --->aaaab
  4312. +0 ^ a*
  4313. +2 ^ ^ b
  4314. +3 ^ ^ End of pattern
  4315. 0: aaaab
  4316. aaaacb
  4317. --->aaaacb
  4318. +0 ^ a*
  4319. +2 ^ ^ b
  4320. +0 ^ a*
  4321. +2 ^ ^ b
  4322. +0 ^ a*
  4323. +2 ^ ^ b
  4324. +0 ^ a*
  4325. +2 ^^ b
  4326. +0 ^ a*
  4327. +2 ^ b
  4328. +3 ^^ End of pattern
  4329. 0: b
  4330. /a*b/IB,auto_callout
  4331. ------------------------------------------------------------------
  4332. Bra
  4333. Callout 255 0 2
  4334. a*+
  4335. Callout 255 2 1
  4336. b
  4337. Callout 255 3 0
  4338. Ket
  4339. End
  4340. ------------------------------------------------------------------
  4341. Capture group count = 0
  4342. Options: auto_callout
  4343. Starting code units: a b
  4344. Last code unit = 'b'
  4345. Subject length lower bound = 1
  4346. ab
  4347. --->ab
  4348. +0 ^ a*
  4349. +2 ^^ b
  4350. +3 ^ ^ End of pattern
  4351. 0: ab
  4352. aaaab
  4353. --->aaaab
  4354. +0 ^ a*
  4355. +2 ^ ^ b
  4356. +3 ^ ^ End of pattern
  4357. 0: aaaab
  4358. aaaacb
  4359. --->aaaacb
  4360. +0 ^ a*
  4361. +2 ^ ^ b
  4362. +0 ^ a*
  4363. +2 ^ ^ b
  4364. +0 ^ a*
  4365. +2 ^ ^ b
  4366. +0 ^ a*
  4367. +2 ^^ b
  4368. +0 ^ a*
  4369. +2 ^ b
  4370. +3 ^^ End of pattern
  4371. 0: b
  4372. /a+b/IB,auto_callout
  4373. ------------------------------------------------------------------
  4374. Bra
  4375. Callout 255 0 2
  4376. a++
  4377. Callout 255 2 1
  4378. b
  4379. Callout 255 3 0
  4380. Ket
  4381. End
  4382. ------------------------------------------------------------------
  4383. Capture group count = 0
  4384. Options: auto_callout
  4385. First code unit = 'a'
  4386. Last code unit = 'b'
  4387. Subject length lower bound = 2
  4388. ab
  4389. --->ab
  4390. +0 ^ a+
  4391. +2 ^^ b
  4392. +3 ^ ^ End of pattern
  4393. 0: ab
  4394. aaaab
  4395. --->aaaab
  4396. +0 ^ a+
  4397. +2 ^ ^ b
  4398. +3 ^ ^ End of pattern
  4399. 0: aaaab
  4400. \= Expect no match
  4401. aaaacb
  4402. --->aaaacb
  4403. +0 ^ a+
  4404. +2 ^ ^ b
  4405. +0 ^ a+
  4406. +2 ^ ^ b
  4407. +0 ^ a+
  4408. +2 ^ ^ b
  4409. +0 ^ a+
  4410. +2 ^^ b
  4411. No match
  4412. /(abc|def)x/IB,auto_callout
  4413. ------------------------------------------------------------------
  4414. Bra
  4415. Callout 255 0 1
  4416. CBra 1
  4417. Callout 255 1 1
  4418. a
  4419. Callout 255 2 1
  4420. b
  4421. Callout 255 3 1
  4422. c
  4423. Callout 255 4 1
  4424. Alt
  4425. Callout 255 5 1
  4426. d
  4427. Callout 255 6 1
  4428. e
  4429. Callout 255 7 1
  4430. f
  4431. Callout 255 8 1
  4432. Ket
  4433. Callout 255 9 1
  4434. x
  4435. Callout 255 10 0
  4436. Ket
  4437. End
  4438. ------------------------------------------------------------------
  4439. Capture group count = 1
  4440. Options: auto_callout
  4441. Starting code units: a d
  4442. Last code unit = 'x'
  4443. Subject length lower bound = 4
  4444. abcx
  4445. --->abcx
  4446. +0 ^ (
  4447. +1 ^ a
  4448. +2 ^^ b
  4449. +3 ^ ^ c
  4450. +4 ^ ^ |
  4451. +9 ^ ^ x
  4452. +10 ^ ^ End of pattern
  4453. 0: abcx
  4454. 1: abc
  4455. defx
  4456. --->defx
  4457. +0 ^ (
  4458. +1 ^ a
  4459. +5 ^ d
  4460. +6 ^^ e
  4461. +7 ^ ^ f
  4462. +8 ^ ^ )
  4463. +9 ^ ^ x
  4464. +10 ^ ^ End of pattern
  4465. 0: defx
  4466. 1: def
  4467. \= Expect no match
  4468. abcdefzx
  4469. --->abcdefzx
  4470. +0 ^ (
  4471. +1 ^ a
  4472. +2 ^^ b
  4473. +3 ^ ^ c
  4474. +4 ^ ^ |
  4475. +9 ^ ^ x
  4476. +5 ^ d
  4477. +0 ^ (
  4478. +1 ^ a
  4479. +5 ^ d
  4480. +6 ^^ e
  4481. +7 ^ ^ f
  4482. +8 ^ ^ )
  4483. +9 ^ ^ x
  4484. No match
  4485. /(abc|def)x/IB,auto_callout
  4486. ------------------------------------------------------------------
  4487. Bra
  4488. Callout 255 0 1
  4489. CBra 1
  4490. Callout 255 1 1
  4491. a
  4492. Callout 255 2 1
  4493. b
  4494. Callout 255 3 1
  4495. c
  4496. Callout 255 4 1
  4497. Alt
  4498. Callout 255 5 1
  4499. d
  4500. Callout 255 6 1
  4501. e
  4502. Callout 255 7 1
  4503. f
  4504. Callout 255 8 1
  4505. Ket
  4506. Callout 255 9 1
  4507. x
  4508. Callout 255 10 0
  4509. Ket
  4510. End
  4511. ------------------------------------------------------------------
  4512. Capture group count = 1
  4513. Options: auto_callout
  4514. Starting code units: a d
  4515. Last code unit = 'x'
  4516. Subject length lower bound = 4
  4517. abcx
  4518. --->abcx
  4519. +0 ^ (
  4520. +1 ^ a
  4521. +2 ^^ b
  4522. +3 ^ ^ c
  4523. +4 ^ ^ |
  4524. +9 ^ ^ x
  4525. +10 ^ ^ End of pattern
  4526. 0: abcx
  4527. 1: abc
  4528. defx
  4529. --->defx
  4530. +0 ^ (
  4531. +1 ^ a
  4532. +5 ^ d
  4533. +6 ^^ e
  4534. +7 ^ ^ f
  4535. +8 ^ ^ )
  4536. +9 ^ ^ x
  4537. +10 ^ ^ End of pattern
  4538. 0: defx
  4539. 1: def
  4540. \= Expect no match
  4541. abcdefzx
  4542. --->abcdefzx
  4543. +0 ^ (
  4544. +1 ^ a
  4545. +2 ^^ b
  4546. +3 ^ ^ c
  4547. +4 ^ ^ |
  4548. +9 ^ ^ x
  4549. +5 ^ d
  4550. +0 ^ (
  4551. +1 ^ a
  4552. +5 ^ d
  4553. +6 ^^ e
  4554. +7 ^ ^ f
  4555. +8 ^ ^ )
  4556. +9 ^ ^ x
  4557. No match
  4558. /(ab|cd){3,4}/I,auto_callout
  4559. Capture group count = 1
  4560. Options: auto_callout
  4561. Starting code units: a c
  4562. Subject length lower bound = 6
  4563. ababab
  4564. --->ababab
  4565. +0 ^ (
  4566. +1 ^ a
  4567. +2 ^^ b
  4568. +3 ^ ^ |
  4569. +1 ^ ^ a
  4570. +2 ^ ^ b
  4571. +3 ^ ^ |
  4572. +1 ^ ^ a
  4573. +2 ^ ^ b
  4574. +3 ^ ^ |
  4575. +1 ^ ^ a
  4576. +4 ^ ^ c
  4577. +12 ^ ^ End of pattern
  4578. 0: ababab
  4579. 1: ab
  4580. abcdabcd
  4581. --->abcdabcd
  4582. +0 ^ (
  4583. +1 ^ a
  4584. +2 ^^ b
  4585. +3 ^ ^ |
  4586. +1 ^ ^ a
  4587. +4 ^ ^ c
  4588. +5 ^ ^ d
  4589. +6 ^ ^ ){3,4}
  4590. +1 ^ ^ a
  4591. +2 ^ ^ b
  4592. +3 ^ ^ |
  4593. +1 ^ ^ a
  4594. +4 ^ ^ c
  4595. +5 ^ ^ d
  4596. +6 ^ ^ ){3,4}
  4597. +12 ^ ^ End of pattern
  4598. 0: abcdabcd
  4599. 1: cd
  4600. abcdcdcdcdcd
  4601. --->abcdcdcdcdcd
  4602. +0 ^ (
  4603. +1 ^ a
  4604. +2 ^^ b
  4605. +3 ^ ^ |
  4606. +1 ^ ^ a
  4607. +4 ^ ^ c
  4608. +5 ^ ^ d
  4609. +6 ^ ^ ){3,4}
  4610. +1 ^ ^ a
  4611. +4 ^ ^ c
  4612. +5 ^ ^ d
  4613. +6 ^ ^ ){3,4}
  4614. +1 ^ ^ a
  4615. +4 ^ ^ c
  4616. +5 ^ ^ d
  4617. +6 ^ ^ ){3,4}
  4618. +12 ^ ^ End of pattern
  4619. 0: abcdcdcd
  4620. 1: cd
  4621. /([ab]{,}c|xy)/IB,auto_callout
  4622. ------------------------------------------------------------------
  4623. Bra
  4624. Callout 255 0 1
  4625. CBra 1
  4626. Callout 255 1 4
  4627. [ab]
  4628. Callout 255 5 1
  4629. {
  4630. Callout 255 6 1
  4631. ,
  4632. Callout 255 7 1
  4633. }
  4634. Callout 255 8 1
  4635. c
  4636. Callout 255 9 1
  4637. Alt
  4638. Callout 255 10 1
  4639. x
  4640. Callout 255 11 1
  4641. y
  4642. Callout 255 12 1
  4643. Ket
  4644. Callout 255 13 0
  4645. Ket
  4646. End
  4647. ------------------------------------------------------------------
  4648. Capture group count = 1
  4649. Options: auto_callout
  4650. Starting code units: a b x
  4651. Subject length lower bound = 2
  4652. \= Expect no match
  4653. Note: that {,} does NOT introduce a quantifier
  4654. --->Note: that {,} does NOT introduce a quantifier
  4655. +0 ^ (
  4656. +1 ^ [ab]
  4657. +5 ^^ {
  4658. +10 ^ x
  4659. +0 ^ (
  4660. +1 ^ [ab]
  4661. +5 ^^ {
  4662. +10 ^ x
  4663. +0 ^ (
  4664. +1 ^ [ab]
  4665. +5 ^^ {
  4666. +10 ^ x
  4667. No match
  4668. /([ab]{,}c|xy)/IB,auto_callout
  4669. ------------------------------------------------------------------
  4670. Bra
  4671. Callout 255 0 1
  4672. CBra 1
  4673. Callout 255 1 4
  4674. [ab]
  4675. Callout 255 5 1
  4676. {
  4677. Callout 255 6 1
  4678. ,
  4679. Callout 255 7 1
  4680. }
  4681. Callout 255 8 1
  4682. c
  4683. Callout 255 9 1
  4684. Alt
  4685. Callout 255 10 1
  4686. x
  4687. Callout 255 11 1
  4688. y
  4689. Callout 255 12 1
  4690. Ket
  4691. Callout 255 13 0
  4692. Ket
  4693. End
  4694. ------------------------------------------------------------------
  4695. Capture group count = 1
  4696. Options: auto_callout
  4697. Starting code units: a b x
  4698. Subject length lower bound = 2
  4699. \= Expect no match
  4700. Note: that {,} does NOT introduce a quantifier
  4701. --->Note: that {,} does NOT introduce a quantifier
  4702. +0 ^ (
  4703. +1 ^ [ab]
  4704. +5 ^^ {
  4705. +10 ^ x
  4706. +0 ^ (
  4707. +1 ^ [ab]
  4708. +5 ^^ {
  4709. +10 ^ x
  4710. +0 ^ (
  4711. +1 ^ [ab]
  4712. +5 ^^ {
  4713. +10 ^ x
  4714. No match
  4715. /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout
  4716. ------------------------------------------------------------------
  4717. Bra
  4718. Callout 255 0 1
  4719. CBra 1
  4720. Callout 255 1 9
  4721. [ab]{1,4}+
  4722. Callout 255 10 1
  4723. c
  4724. Callout 255 11 1
  4725. Alt
  4726. Callout 255 12 1
  4727. x
  4728. Callout 255 13 1
  4729. y
  4730. Callout 255 14 7
  4731. Ket
  4732. CBra 1
  4733. Callout 255 1 9
  4734. [ab]{1,4}+
  4735. Callout 255 10 1
  4736. c
  4737. Callout 255 11 1
  4738. Alt
  4739. Callout 255 12 1
  4740. x
  4741. Callout 255 13 1
  4742. y
  4743. Callout 255 14 7
  4744. Ket
  4745. CBra 1
  4746. Callout 255 1 9
  4747. [ab]{1,4}+
  4748. Callout 255 10 1
  4749. c
  4750. Callout 255 11 1
  4751. Alt
  4752. Callout 255 12 1
  4753. x
  4754. Callout 255 13 1
  4755. y
  4756. Callout 255 14 7
  4757. Ket
  4758. CBra 1
  4759. Callout 255 1 9
  4760. [ab]{1,4}+
  4761. Callout 255 10 1
  4762. c
  4763. Callout 255 11 1
  4764. Alt
  4765. Callout 255 12 1
  4766. x
  4767. Callout 255 13 1
  4768. y
  4769. Callout 255 14 7
  4770. Ket
  4771. Braminzero
  4772. CBra 1
  4773. Callout 255 1 9
  4774. [ab]{1,4}+
  4775. Callout 255 10 1
  4776. c
  4777. Callout 255 11 1
  4778. Alt
  4779. Callout 255 12 1
  4780. x
  4781. Callout 255 13 1
  4782. y
  4783. Callout 255 14 7
  4784. Ket
  4785. Callout 255 21 1
  4786. 1
  4787. Callout 255 22 1
  4788. 2
  4789. Callout 255 23 1
  4790. 3
  4791. Callout 255 24 0
  4792. Ket
  4793. End
  4794. ------------------------------------------------------------------
  4795. Capture group count = 1
  4796. Options: auto_callout
  4797. Starting code units: a b x
  4798. Last code unit = '3'
  4799. Subject length lower bound = 11
  4800. aacaacaacaacaac123
  4801. --->aacaacaacaacaac123
  4802. +0 ^ (
  4803. +1 ^ [ab]{1,4}
  4804. +10 ^ ^ c
  4805. +11 ^ ^ |
  4806. +1 ^ ^ [ab]{1,4}
  4807. +10 ^ ^ c
  4808. +11 ^ ^ |
  4809. +1 ^ ^ [ab]{1,4}
  4810. +10 ^ ^ c
  4811. +11 ^ ^ |
  4812. +1 ^ ^ [ab]{1,4}
  4813. +10 ^ ^ c
  4814. +11 ^ ^ |
  4815. +21 ^ ^ 1
  4816. +1 ^ ^ [ab]{1,4}
  4817. +10 ^ ^ c
  4818. +11 ^ ^ |
  4819. +21 ^ ^ 1
  4820. +22 ^ ^ 2
  4821. +23 ^ ^ 3
  4822. +24 ^ ^ End of pattern
  4823. 0: aacaacaacaacaac123
  4824. 1: aac
  4825. /\b.*/I
  4826. Capture group count = 0
  4827. Max lookbehind = 1
  4828. May match empty string
  4829. Subject length lower bound = 0
  4830. ab cd\=offset=1
  4831. 0: cd
  4832. /\b.*/Is
  4833. Capture group count = 0
  4834. Max lookbehind = 1
  4835. May match empty string
  4836. Options: dotall
  4837. Subject length lower bound = 0
  4838. ab cd\=startoffset=1
  4839. 0: cd
  4840. /(?!.bcd).*/I
  4841. Capture group count = 0
  4842. May match empty string
  4843. Subject length lower bound = 0
  4844. Xbcd12345
  4845. 0: bcd12345
  4846. /abcde/I
  4847. Capture group count = 0
  4848. First code unit = 'a'
  4849. Last code unit = 'e'
  4850. Subject length lower bound = 5
  4851. ab\=ps
  4852. Partial match: ab
  4853. abc\=ps
  4854. Partial match: abc
  4855. abcd\=ps
  4856. Partial match: abcd
  4857. abcde\=ps
  4858. 0: abcde
  4859. the quick brown abc\=ps
  4860. Partial match: abc
  4861. \= Expect no match\=ps
  4862. the quick brown abxyz fox\=ps
  4863. No match
  4864. "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
  4865. Capture group count = 3
  4866. Compile options: <none>
  4867. Overall options: anchored
  4868. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4869. Last code unit = '/'
  4870. Subject length lower bound = 6
  4871. 13/05/04\=ps
  4872. 0: 13/05/04
  4873. 1: 13
  4874. 2: 05
  4875. 13/5/2004\=ps
  4876. 0: 13/5/2004
  4877. 1: 13
  4878. 2: 5
  4879. 3: 20
  4880. 02/05/09\=ps
  4881. 0: 02/05/09
  4882. 1: 02
  4883. 2: 05
  4884. 1\=ps
  4885. Partial match: 1
  4886. 1/2\=ps
  4887. Partial match: 1/2
  4888. 1/2/0\=ps
  4889. Partial match: 1/2/0
  4890. 1/2/04\=ps
  4891. 0: 1/2/04
  4892. 1: 1
  4893. 2: 2
  4894. 0\=ps
  4895. Partial match: 0
  4896. 02/\=ps
  4897. Partial match: 02/
  4898. 02/0\=ps
  4899. Partial match: 02/0
  4900. 02/1\=ps
  4901. Partial match: 02/1
  4902. \= Expect no match\=ps
  4903. \=ps
  4904. No match
  4905. 123\=ps
  4906. No match
  4907. 33/4/04\=ps
  4908. No match
  4909. 3/13/04\=ps
  4910. No match
  4911. 0/1/2003\=ps
  4912. No match
  4913. 0/\=ps
  4914. No match
  4915. 02/0/\=ps
  4916. No match
  4917. 02/13\=ps
  4918. No match
  4919. /0{0,2}ABC/I
  4920. Capture group count = 0
  4921. Starting code units: 0 A
  4922. Last code unit = 'C'
  4923. Subject length lower bound = 3
  4924. /\d{3,}ABC/I
  4925. Capture group count = 0
  4926. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4927. Last code unit = 'C'
  4928. Subject length lower bound = 6
  4929. /\d*ABC/I
  4930. Capture group count = 0
  4931. Starting code units: 0 1 2 3 4 5 6 7 8 9 A
  4932. Last code unit = 'C'
  4933. Subject length lower bound = 3
  4934. /[abc]+DE/I
  4935. Capture group count = 0
  4936. Starting code units: a b c
  4937. Last code unit = 'E'
  4938. Subject length lower bound = 3
  4939. /[abc]?123/I
  4940. Capture group count = 0
  4941. Starting code units: 1 a b c
  4942. Last code unit = '3'
  4943. Subject length lower bound = 3
  4944. 123\=ps
  4945. 0: 123
  4946. a\=ps
  4947. Partial match: a
  4948. b\=ps
  4949. Partial match: b
  4950. c\=ps
  4951. Partial match: c
  4952. c12\=ps
  4953. Partial match: c12
  4954. c123\=ps
  4955. 0: c123
  4956. /^(?:\d){3,5}X/I
  4957. Capture group count = 0
  4958. Compile options: <none>
  4959. Overall options: anchored
  4960. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4961. Last code unit = 'X'
  4962. Subject length lower bound = 4
  4963. 1\=ps
  4964. Partial match: 1
  4965. 123\=ps
  4966. Partial match: 123
  4967. 123X
  4968. 0: 123X
  4969. 1234\=ps
  4970. Partial match: 1234
  4971. 1234X
  4972. 0: 1234X
  4973. 12345\=ps
  4974. Partial match: 12345
  4975. 12345X
  4976. 0: 12345X
  4977. \= Expect no match
  4978. 1X
  4979. No match
  4980. 123456\=ps
  4981. No match
  4982. "<(\w+)/?>(.)*</(\1)>"Igms
  4983. Capture group count = 3
  4984. Max back reference = 1
  4985. Options: dotall multiline
  4986. First code unit = '<'
  4987. Last code unit = '>'
  4988. Subject length lower bound = 7
  4989. <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>\=jitstack=1024
  4990. 0: <seite>\x0a<dokumenteninformation>\x0a<seitentitel>Partner der LCO</seitentitel>\x0a<sprache>de</sprache>\x0a<seitenbeschreibung>Partner der LINEAS Consulting\x0aGmbH</seitenbeschreibung>\x0a<schluesselworte>LINEAS Consulting GmbH Hamburg\x0aPartnerfirmen</schluesselworte>\x0a<revisit>30 days</revisit>\x0a<robots>index,follow</robots>\x0a<menueinformation>\x0a<aktiv>ja</aktiv>\x0a<menueposition>3</menueposition>\x0a<menuetext>Partner</menuetext>\x0a</menueinformation>\x0a<lastedited>\x0a<autor>LCO</autor>\x0a<firma>LINEAS Consulting</firma>\x0a<datum>15.10.2003</datum>\x0a</lastedited>\x0a</dokumenteninformation>\x0a<inhalt>\x0a\x0a<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\x0aGmbH</absatzueberschrift>\x0a\x0a<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\x0a<bild name="logo_ca.gif" rahmen="no"/></link> <link\x0aziel="http://www.ey.com/" zielfenster="_blank"><bild\x0aname="logo_euy.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\x0a<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.atelion.de/"\x0azielfenster="_blank"><bild\x0aname="logo_atelion.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.line-information.de/"\x0azielfenster="_blank">\x0a<bild name="logo_line_information.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\x0a\x0a<absatz><link ziel="http://www.incognis.de/"\x0azielfenster="_blank"><bild\x0aname="logo_incognis.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.addcraft.com/"\x0azielfenster="_blank"><bild\x0aname="logo_addcraft.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.comendo.com/"\x0azielfenster="_blank"><bild\x0aname="logo_comendo.gif" rahmen="no"/></link></absatz>\x0a\x0a</inhalt>\x0a</seite>
  4991. 1: seite
  4992. 2: \x0a
  4993. 3: seite
  4994. /line\nbreak/I
  4995. Capture group count = 0
  4996. Contains explicit CR or LF match
  4997. First code unit = 'l'
  4998. Last code unit = 'k'
  4999. Subject length lower bound = 10
  5000. this is a line\nbreak
  5001. 0: line\x0abreak
  5002. line one\nthis is a line\nbreak in the second line
  5003. 0: line\x0abreak
  5004. /line\nbreak/I,firstline
  5005. Capture group count = 0
  5006. Contains explicit CR or LF match
  5007. Options: firstline
  5008. First code unit = 'l'
  5009. Last code unit = 'k'
  5010. Subject length lower bound = 10
  5011. this is a line\nbreak
  5012. 0: line\x0abreak
  5013. \= Expect no match
  5014. line one\nthis is a line\nbreak in the second line
  5015. No match
  5016. /line\nbreak/Im,firstline
  5017. Capture group count = 0
  5018. Contains explicit CR or LF match
  5019. Options: firstline multiline
  5020. First code unit = 'l'
  5021. Last code unit = 'k'
  5022. Subject length lower bound = 10
  5023. this is a line\nbreak
  5024. 0: line\x0abreak
  5025. \= Expect no match
  5026. line one\nthis is a line\nbreak in the second line
  5027. No match
  5028. /(?i)(?-i)AbCd/I
  5029. Capture group count = 0
  5030. First code unit = 'A'
  5031. Last code unit = 'd'
  5032. Subject length lower bound = 4
  5033. AbCd
  5034. 0: AbCd
  5035. \= Expect no match
  5036. abcd
  5037. No match
  5038. /a{11111111111111111111}/I
  5039. Failed: error 105 at offset 8: number too big in {} quantifier
  5040. /(){64294967295}/I
  5041. Failed: error 105 at offset 9: number too big in {} quantifier
  5042. /(){2,4294967295}/I
  5043. Failed: error 105 at offset 11: number too big in {} quantifier
  5044. "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
  5045. Capture group count = 1
  5046. Max back reference = 1
  5047. First code unit = 'a' (caseless)
  5048. Last code unit = 'B'
  5049. Subject length lower bound = 15
  5050. abcdefghijklAkB
  5051. 0: abcdefghijklAkB
  5052. 1: k
  5053. "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
  5054. Capture group count = 12
  5055. Max back reference = 11
  5056. Named capture groups:
  5057. n0 1
  5058. n1 2
  5059. n10 11
  5060. n11 12
  5061. n2 3
  5062. n3 4
  5063. n4 5
  5064. n5 6
  5065. n6 7
  5066. n7 8
  5067. n8 9
  5068. n9 10
  5069. First code unit = 'a'
  5070. Last code unit = 'B'
  5071. Subject length lower bound = 15
  5072. abcdefghijklAkB
  5073. 0: abcdefghijklAkB
  5074. 1: a
  5075. 2: b
  5076. 3: c
  5077. 4: d
  5078. 5: e
  5079. 6: f
  5080. 7: g
  5081. 8: h
  5082. 9: i
  5083. 10: j
  5084. 11: k
  5085. 12: l
  5086. "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
  5087. Capture group count = 12
  5088. Max back reference = 11
  5089. First code unit = 'a'
  5090. Last code unit = 'B'
  5091. Subject length lower bound = 15
  5092. abcdefghijklAkB
  5093. 0: abcdefghijklAkB
  5094. 1: a
  5095. 2: b
  5096. 3: c
  5097. 4: d
  5098. 5: e
  5099. 6: f
  5100. 7: g
  5101. 8: h
  5102. 9: i
  5103. 10: j
  5104. 11: k
  5105. 12: l
  5106. "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
  5107. Capture group count = 101
  5108. Named capture groups:
  5109. name0 1
  5110. name1 2
  5111. name10 11
  5112. name100 101
  5113. name11 12
  5114. name12 13
  5115. name13 14
  5116. name14 15
  5117. name15 16
  5118. name16 17
  5119. name17 18
  5120. name18 19
  5121. name19 20
  5122. name2 3
  5123. name20 21
  5124. name21 22
  5125. name22 23
  5126. name23 24
  5127. name24 25
  5128. name25 26
  5129. name26 27
  5130. name27 28
  5131. name28 29
  5132. name29 30
  5133. name3 4
  5134. name30 31
  5135. name31 32
  5136. name32 33
  5137. name33 34
  5138. name34 35
  5139. name35 36
  5140. name36 37
  5141. name37 38
  5142. name38 39
  5143. name39 40
  5144. name4 5
  5145. name40 41
  5146. name41 42
  5147. name42 43
  5148. name43 44
  5149. name44 45
  5150. name45 46
  5151. name46 47
  5152. name47 48
  5153. name48 49
  5154. name49 50
  5155. name5 6
  5156. name50 51
  5157. name51 52
  5158. name52 53
  5159. name53 54
  5160. name54 55
  5161. name55 56
  5162. name56 57
  5163. name57 58
  5164. name58 59
  5165. name59 60
  5166. name6 7
  5167. name60 61
  5168. name61 62
  5169. name62 63
  5170. name63 64
  5171. name64 65
  5172. name65 66
  5173. name66 67
  5174. name67 68
  5175. name68 69
  5176. name69 70
  5177. name7 8
  5178. name70 71
  5179. name71 72
  5180. name72 73
  5181. name73 74
  5182. name74 75
  5183. name75 76
  5184. name76 77
  5185. name77 78
  5186. name78 79
  5187. name79 80
  5188. name8 9
  5189. name80 81
  5190. name81 82
  5191. name82 83
  5192. name83 84
  5193. name84 85
  5194. name85 86
  5195. name86 87
  5196. name87 88
  5197. name88 89
  5198. name89 90
  5199. name9 10
  5200. name90 91
  5201. name91 92
  5202. name92 93
  5203. name93 94
  5204. name94 95
  5205. name95 96
  5206. name96 97
  5207. name97 98
  5208. name98 99
  5209. name99 100
  5210. First code unit = 'a'
  5211. Last code unit = 'a'
  5212. Subject length lower bound = 101
  5213. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5214. Matched, but too many substrings
  5215. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5216. 1: a
  5217. 2: a
  5218. 3: a
  5219. 4: a
  5220. 5: a
  5221. 6: a
  5222. 7: a
  5223. 8: a
  5224. 9: a
  5225. 10: a
  5226. 11: a
  5227. 12: a
  5228. 13: a
  5229. 14: a
  5230. "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
  5231. Capture group count = 101
  5232. First code unit = 'a'
  5233. Last code unit = 'a'
  5234. Subject length lower bound = 101
  5235. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5236. Matched, but too many substrings
  5237. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5238. 1: a
  5239. 2: a
  5240. 3: a
  5241. 4: a
  5242. 5: a
  5243. 6: a
  5244. 7: a
  5245. 8: a
  5246. 9: a
  5247. 10: a
  5248. 11: a
  5249. 12: a
  5250. 13: a
  5251. 14: a
  5252. /[^()]*(?:\((?R)\)[^()]*)*/I
  5253. Capture group count = 0
  5254. May match empty string
  5255. Subject length lower bound = 0
  5256. (this(and)that
  5257. 0:
  5258. (this(and)that)
  5259. 0: (this(and)that)
  5260. (this(and)that)stuff
  5261. 0: (this(and)that)stuff
  5262. /[^()]*(?:\((?>(?R))\)[^()]*)*/I
  5263. Capture group count = 0
  5264. May match empty string
  5265. Subject length lower bound = 0
  5266. (this(and)that
  5267. 0:
  5268. (this(and)that)
  5269. 0: (this(and)that)
  5270. /[^()]*(?:\((?R)\))*[^()]*/I
  5271. Capture group count = 0
  5272. May match empty string
  5273. Subject length lower bound = 0
  5274. (this(and)that
  5275. 0:
  5276. (this(and)that)
  5277. 0: (this(and)that)
  5278. /(?:\((?R)\))*[^()]*/I
  5279. Capture group count = 0
  5280. May match empty string
  5281. Subject length lower bound = 0
  5282. (this(and)that
  5283. 0:
  5284. (this(and)that)
  5285. 0:
  5286. ((this))
  5287. 0: ((this))
  5288. /(?:\((?R)\))|[^()]*/I
  5289. Capture group count = 0
  5290. May match empty string
  5291. Subject length lower bound = 0
  5292. (this(and)that
  5293. 0:
  5294. (this(and)that)
  5295. 0:
  5296. (this)
  5297. 0: (this)
  5298. ((this))
  5299. 0: ((this))
  5300. /\x{0000ff}/I
  5301. Capture group count = 0
  5302. First code unit = \xff
  5303. Subject length lower bound = 1
  5304. /^((?P<A>a1)|(?P<A>a2)b)/I
  5305. Failed: error 143 at offset 18: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  5306. /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
  5307. Capture group count = 3
  5308. Named capture groups:
  5309. A 2
  5310. A 3
  5311. Compile options: dupnames
  5312. Overall options: anchored dupnames
  5313. First code unit = 'a'
  5314. Subject length lower bound = 2
  5315. a1b\=copy=A
  5316. 0: a1
  5317. 1: a1
  5318. 2: a1
  5319. C a1 (2) A (non-unique)
  5320. a2b\=copy=A
  5321. 0: a2b
  5322. 1: a2b
  5323. 2: <unset>
  5324. 3: a2
  5325. C a2 (2) A (non-unique)
  5326. a1b\=copy=Z,copy=A
  5327. 0: a1
  5328. 1: a1
  5329. 2: a1
  5330. Number not found for group 'Z'
  5331. Copy substring 'Z' failed (-49): unknown substring
  5332. C a1 (2) A (non-unique)
  5333. /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
  5334. Capture group count = 3
  5335. Named capture groups:
  5336. a 1
  5337. a 3
  5338. b 2
  5339. May match empty string
  5340. Options: dupnames
  5341. Subject length lower bound = 0
  5342. /^(?P<A>a)(?P<A>b)/I,dupnames
  5343. Capture group count = 2
  5344. Named capture groups:
  5345. A 1
  5346. A 2
  5347. Compile options: dupnames
  5348. Overall options: anchored dupnames
  5349. First code unit = 'a'
  5350. Subject length lower bound = 2
  5351. ab\=copy=A
  5352. 0: ab
  5353. 1: a
  5354. 2: b
  5355. C a (1) A (non-unique)
  5356. /^(?P<A>a)(?P<A>b)|cd/I,dupnames
  5357. Capture group count = 2
  5358. Named capture groups:
  5359. A 1
  5360. A 2
  5361. Options: dupnames
  5362. Starting code units: a c
  5363. Subject length lower bound = 2
  5364. ab\=copy=A
  5365. 0: ab
  5366. 1: a
  5367. 2: b
  5368. C a (1) A (non-unique)
  5369. cd\=copy=A
  5370. 0: cd
  5371. Copy substring 'A' failed (-55): requested value is not set
  5372. /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
  5373. Capture group count = 4
  5374. Named capture groups:
  5375. A 1
  5376. A 2
  5377. A 3
  5378. A 4
  5379. Options: dupnames
  5380. Starting code units: a c
  5381. Subject length lower bound = 2
  5382. cdefgh\=copy=A
  5383. 0: cdefgh
  5384. 1: <unset>
  5385. 2: <unset>
  5386. 3: ef
  5387. 4: gh
  5388. C ef (2) A (non-unique)
  5389. /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
  5390. Capture group count = 3
  5391. Named capture groups:
  5392. A 2
  5393. A 3
  5394. Compile options: dupnames
  5395. Overall options: anchored dupnames
  5396. First code unit = 'a'
  5397. Subject length lower bound = 2
  5398. a1b\=get=A
  5399. 0: a1
  5400. 1: a1
  5401. 2: a1
  5402. G a1 (2) A (non-unique)
  5403. a2b\=get=A
  5404. 0: a2b
  5405. 1: a2b
  5406. 2: <unset>
  5407. 3: a2
  5408. G a2 (2) A (non-unique)
  5409. a1b\=get=Z,get=A
  5410. 0: a1
  5411. 1: a1
  5412. 2: a1
  5413. Number not found for group 'Z'
  5414. Get substring 'Z' failed (-49): unknown substring
  5415. G a1 (2) A (non-unique)
  5416. /^(?P<A>a)(?P<A>b)/I,dupnames
  5417. Capture group count = 2
  5418. Named capture groups:
  5419. A 1
  5420. A 2
  5421. Compile options: dupnames
  5422. Overall options: anchored dupnames
  5423. First code unit = 'a'
  5424. Subject length lower bound = 2
  5425. ab\=get=A
  5426. 0: ab
  5427. 1: a
  5428. 2: b
  5429. G a (1) A (non-unique)
  5430. /^(?P<A>a)(?P<A>b)|cd/I,dupnames
  5431. Capture group count = 2
  5432. Named capture groups:
  5433. A 1
  5434. A 2
  5435. Options: dupnames
  5436. Starting code units: a c
  5437. Subject length lower bound = 2
  5438. ab\=get=A
  5439. 0: ab
  5440. 1: a
  5441. 2: b
  5442. G a (1) A (non-unique)
  5443. cd\=get=A
  5444. 0: cd
  5445. Get substring 'A' failed (-55): requested value is not set
  5446. /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
  5447. Capture group count = 4
  5448. Named capture groups:
  5449. A 1
  5450. A 2
  5451. A 3
  5452. A 4
  5453. Options: dupnames
  5454. Starting code units: a c
  5455. Subject length lower bound = 2
  5456. cdefgh\=get=A
  5457. 0: cdefgh
  5458. 1: <unset>
  5459. 2: <unset>
  5460. 3: ef
  5461. 4: gh
  5462. G ef (2) A (non-unique)
  5463. /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
  5464. Capture group count = 3
  5465. Named capture groups:
  5466. A 2
  5467. A 3
  5468. Compile options: <none>
  5469. Overall options: anchored
  5470. Duplicate name status changes
  5471. First code unit = 'a'
  5472. Subject length lower bound = 2
  5473. a1b\=copy=A
  5474. 0: a1
  5475. 1: a1
  5476. 2: a1
  5477. C a1 (2) A (non-unique)
  5478. a2b\=copy=A
  5479. 0: a2b
  5480. 1: a2b
  5481. 2: <unset>
  5482. 3: a2
  5483. C a2 (2) A (non-unique)
  5484. /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
  5485. Failed: error 143 at offset 38: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  5486. # In this next test, J is not set at the outer level; consequently it isn't set
  5487. # in the pattern's options; consequently pcre2_substring_get_byname() produces
  5488. # a random value.
  5489. /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
  5490. Capture group count = 4
  5491. Named capture groups:
  5492. A 1
  5493. B 2
  5494. B 3
  5495. C 4
  5496. Compile options: <none>
  5497. Overall options: anchored
  5498. Duplicate name status changes
  5499. First code unit = 'a'
  5500. Subject length lower bound = 6
  5501. a bc d\=copy=A,copy=B,copy=C
  5502. 0: a bc d
  5503. 1: a
  5504. 2: b
  5505. 3: c
  5506. 4: d
  5507. C a (1) A (group 1)
  5508. C b (1) B (non-unique)
  5509. C d (1) C (group 4)
  5510. /^(?P<A>a)?(?(A)a|b)/I
  5511. Capture group count = 1
  5512. Max back reference = 1
  5513. Named capture groups:
  5514. A 1
  5515. Compile options: <none>
  5516. Overall options: anchored
  5517. Subject length lower bound = 1
  5518. aabc
  5519. 0: aa
  5520. 1: a
  5521. bc
  5522. 0: b
  5523. \= Expect no match
  5524. abc
  5525. No match
  5526. /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
  5527. Capture group count = 1
  5528. Max back reference = 1
  5529. Named capture groups:
  5530. ZZ 1
  5531. Last code unit = 'X'
  5532. Subject length lower bound = 2
  5533. bXaX
  5534. 0: bXaX
  5535. 1: X
  5536. /(?:(?(2y)a|b)(X))+/I
  5537. Failed: error 124 at offset 7: missing closing parenthesis for condition
  5538. /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
  5539. Failed: error 115 at offset 6: reference to non-existent subpattern
  5540. /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
  5541. Capture group count = 1
  5542. Max back reference = 1
  5543. Named capture groups:
  5544. ZZ 1
  5545. Last code unit = 'X'
  5546. Subject length lower bound = 3
  5547. bbXaaX
  5548. 0: bbXaaX
  5549. 1: X
  5550. /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
  5551. Capture group count = 1
  5552. Max back reference = 1
  5553. Named capture groups:
  5554. ZZ 1
  5555. Last code unit = 'X'
  5556. Subject length lower bound = 3
  5557. (b)\\Xa\\X
  5558. 0: (b)\Xa\X
  5559. 1: X
  5560. /(?P<ABC/I
  5561. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  5562. /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
  5563. Capture group count = 1
  5564. Max back reference = 1
  5565. Named capture groups:
  5566. A 1
  5567. Subject length lower bound = 2
  5568. bXXaYYaY
  5569. 0: bXXaYYaY
  5570. 1: Y
  5571. bXYaXXaX
  5572. 0: bX
  5573. 1: X
  5574. /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
  5575. Capture group count = 10
  5576. Max back reference = 10
  5577. Named capture groups:
  5578. A 10
  5579. Subject length lower bound = 2
  5580. bXXaYYaY
  5581. 0: bXXaYYaY
  5582. 1:
  5583. 2:
  5584. 3:
  5585. 4:
  5586. 5:
  5587. 6:
  5588. 7:
  5589. 8:
  5590. 9:
  5591. 10: Y
  5592. /\s*,\s*/I
  5593. Capture group count = 0
  5594. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 ,
  5595. Last code unit = ','
  5596. Subject length lower bound = 1
  5597. \x0b,\x0b
  5598. 0: \x0b,\x0b
  5599. \x0c,\x0d
  5600. 0: \x0c,\x0d
  5601. /^abc/Im,newline=lf
  5602. Capture group count = 0
  5603. Options: multiline
  5604. Forced newline is LF
  5605. First code unit at start or follows newline
  5606. Last code unit = 'c'
  5607. Subject length lower bound = 3
  5608. xyz\nabc
  5609. 0: abc
  5610. xyz\r\nabc
  5611. 0: abc
  5612. \= Expect no match
  5613. xyz\rabc
  5614. No match
  5615. xyzabc\r
  5616. No match
  5617. xyzabc\rpqr
  5618. No match
  5619. xyzabc\r\n
  5620. No match
  5621. xyzabc\r\npqr
  5622. No match
  5623. /^abc/Im,newline=crlf
  5624. Capture group count = 0
  5625. Options: multiline
  5626. Forced newline is CRLF
  5627. First code unit at start or follows newline
  5628. Last code unit = 'c'
  5629. Subject length lower bound = 3
  5630. xyz\r\nabclf>
  5631. 0: abc
  5632. \= Expect no match
  5633. xyz\nabclf
  5634. No match
  5635. xyz\rabclf
  5636. No match
  5637. /^abc/Im,newline=cr
  5638. Capture group count = 0
  5639. Options: multiline
  5640. Forced newline is CR
  5641. First code unit at start or follows newline
  5642. Last code unit = 'c'
  5643. Subject length lower bound = 3
  5644. xyz\rabc
  5645. 0: abc
  5646. \= Expect no match
  5647. xyz\nabc
  5648. No match
  5649. xyz\r\nabc
  5650. No match
  5651. /^abc/Im,newline=bad
  5652. ** Invalid value in 'newline=bad'
  5653. /.*/I,newline=lf
  5654. Capture group count = 0
  5655. May match empty string
  5656. Forced newline is LF
  5657. First code unit at start or follows newline
  5658. Subject length lower bound = 0
  5659. abc\ndef
  5660. 0: abc
  5661. abc\rdef
  5662. 0: abc\x0ddef
  5663. abc\r\ndef
  5664. 0: abc\x0d
  5665. /.*/I,newline=cr
  5666. Capture group count = 0
  5667. May match empty string
  5668. Forced newline is CR
  5669. First code unit at start or follows newline
  5670. Subject length lower bound = 0
  5671. abc\ndef
  5672. 0: abc\x0adef
  5673. abc\rdef
  5674. 0: abc
  5675. abc\r\ndef
  5676. 0: abc
  5677. /.*/I,newline=crlf
  5678. Capture group count = 0
  5679. May match empty string
  5680. Forced newline is CRLF
  5681. First code unit at start or follows newline
  5682. Subject length lower bound = 0
  5683. abc\ndef
  5684. 0: abc\x0adef
  5685. abc\rdef
  5686. 0: abc\x0ddef
  5687. abc\r\ndef
  5688. 0: abc
  5689. /\w+(.)(.)?def/Is
  5690. Capture group count = 2
  5691. Options: dotall
  5692. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  5693. Q R S T U V W X Y Z _ 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
  5694. Last code unit = 'f'
  5695. Subject length lower bound = 5
  5696. abc\ndef
  5697. 0: abc\x0adef
  5698. 1: \x0a
  5699. abc\rdef
  5700. 0: abc\x0ddef
  5701. 1: \x0d
  5702. abc\r\ndef
  5703. 0: abc\x0d\x0adef
  5704. 1: \x0d
  5705. 2: \x0a
  5706. /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
  5707. Capture group count = 1
  5708. Named capture groups:
  5709. B 1
  5710. Starting code units: 0 1 2 3 4 5 6 7 8 9
  5711. Last code unit = '.'
  5712. Subject length lower bound = 7
  5713. /()()()()()()()()()()()()()()()()()()()()
  5714. ()()()()()()()()()()()()()()()()()()()()
  5715. ()()()()()()()()()()()()()()()()()()()()
  5716. ()()()()()()()()()()()()()()()()()()()()
  5717. ()()()()()()()()()()()()()()()()()()()()
  5718. (.(.))/Ix
  5719. Capture group count = 102
  5720. Options: extended
  5721. Subject length lower bound = 2
  5722. XY\=ovector=133
  5723. 0: XY
  5724. 1:
  5725. 2:
  5726. 3:
  5727. 4:
  5728. 5:
  5729. 6:
  5730. 7:
  5731. 8:
  5732. 9:
  5733. 10:
  5734. 11:
  5735. 12:
  5736. 13:
  5737. 14:
  5738. 15:
  5739. 16:
  5740. 17:
  5741. 18:
  5742. 19:
  5743. 20:
  5744. 21:
  5745. 22:
  5746. 23:
  5747. 24:
  5748. 25:
  5749. 26:
  5750. 27:
  5751. 28:
  5752. 29:
  5753. 30:
  5754. 31:
  5755. 32:
  5756. 33:
  5757. 34:
  5758. 35:
  5759. 36:
  5760. 37:
  5761. 38:
  5762. 39:
  5763. 40:
  5764. 41:
  5765. 42:
  5766. 43:
  5767. 44:
  5768. 45:
  5769. 46:
  5770. 47:
  5771. 48:
  5772. 49:
  5773. 50:
  5774. 51:
  5775. 52:
  5776. 53:
  5777. 54:
  5778. 55:
  5779. 56:
  5780. 57:
  5781. 58:
  5782. 59:
  5783. 60:
  5784. 61:
  5785. 62:
  5786. 63:
  5787. 64:
  5788. 65:
  5789. 66:
  5790. 67:
  5791. 68:
  5792. 69:
  5793. 70:
  5794. 71:
  5795. 72:
  5796. 73:
  5797. 74:
  5798. 75:
  5799. 76:
  5800. 77:
  5801. 78:
  5802. 79:
  5803. 80:
  5804. 81:
  5805. 82:
  5806. 83:
  5807. 84:
  5808. 85:
  5809. 86:
  5810. 87:
  5811. 88:
  5812. 89:
  5813. 90:
  5814. 91:
  5815. 92:
  5816. 93:
  5817. 94:
  5818. 95:
  5819. 96:
  5820. 97:
  5821. 98:
  5822. 99:
  5823. 100:
  5824. 101: XY
  5825. 102: Y
  5826. /(a*b|(?i:c*(?-i)d))/I
  5827. Capture group count = 1
  5828. Starting code units: C a b c d
  5829. Subject length lower bound = 1
  5830. /()[ab]xyz/I
  5831. Capture group count = 1
  5832. Starting code units: a b
  5833. Last code unit = 'z'
  5834. Subject length lower bound = 4
  5835. /(|)[ab]xyz/I
  5836. Capture group count = 1
  5837. Starting code units: a b
  5838. Last code unit = 'z'
  5839. Subject length lower bound = 4
  5840. /(|c)[ab]xyz/I
  5841. Capture group count = 1
  5842. Starting code units: a b c
  5843. Last code unit = 'z'
  5844. Subject length lower bound = 4
  5845. /(|c?)[ab]xyz/I
  5846. Capture group count = 1
  5847. Starting code units: a b c
  5848. Last code unit = 'z'
  5849. Subject length lower bound = 4
  5850. /(d?|c?)[ab]xyz/I
  5851. Capture group count = 1
  5852. Starting code units: a b c d
  5853. Last code unit = 'z'
  5854. Subject length lower bound = 4
  5855. /(d?|c)[ab]xyz/I
  5856. Capture group count = 1
  5857. Starting code units: a b c d
  5858. Last code unit = 'z'
  5859. Subject length lower bound = 4
  5860. /^a*b\d/IB
  5861. ------------------------------------------------------------------
  5862. Bra
  5863. ^
  5864. a*+
  5865. b
  5866. \d
  5867. Ket
  5868. End
  5869. ------------------------------------------------------------------
  5870. Capture group count = 0
  5871. Compile options: <none>
  5872. Overall options: anchored
  5873. Starting code units: a b
  5874. Last code unit = 'b'
  5875. Subject length lower bound = 2
  5876. /^a*+b\d/IB
  5877. ------------------------------------------------------------------
  5878. Bra
  5879. ^
  5880. a*+
  5881. b
  5882. \d
  5883. Ket
  5884. End
  5885. ------------------------------------------------------------------
  5886. Capture group count = 0
  5887. Compile options: <none>
  5888. Overall options: anchored
  5889. Starting code units: a b
  5890. Last code unit = 'b'
  5891. Subject length lower bound = 2
  5892. /^a*?b\d/IB
  5893. ------------------------------------------------------------------
  5894. Bra
  5895. ^
  5896. a*+
  5897. b
  5898. \d
  5899. Ket
  5900. End
  5901. ------------------------------------------------------------------
  5902. Capture group count = 0
  5903. Compile options: <none>
  5904. Overall options: anchored
  5905. Starting code units: a b
  5906. Last code unit = 'b'
  5907. Subject length lower bound = 2
  5908. /^a+A\d/IB
  5909. ------------------------------------------------------------------
  5910. Bra
  5911. ^
  5912. a++
  5913. A
  5914. \d
  5915. Ket
  5916. End
  5917. ------------------------------------------------------------------
  5918. Capture group count = 0
  5919. Compile options: <none>
  5920. Overall options: anchored
  5921. First code unit = 'a'
  5922. Last code unit = 'A'
  5923. Subject length lower bound = 3
  5924. aaaA5
  5925. 0: aaaA5
  5926. \= Expect no match
  5927. aaaa5
  5928. No match
  5929. /^a*A\d/IBi
  5930. ------------------------------------------------------------------
  5931. Bra
  5932. ^
  5933. /i a*
  5934. /i A
  5935. \d
  5936. Ket
  5937. End
  5938. ------------------------------------------------------------------
  5939. Capture group count = 0
  5940. Compile options: caseless
  5941. Overall options: anchored caseless
  5942. Starting code units: A a
  5943. Last code unit = 'A' (caseless)
  5944. Subject length lower bound = 2
  5945. aaaA5
  5946. 0: aaaA5
  5947. aaaa5
  5948. 0: aaaa5
  5949. a5
  5950. 0: a5
  5951. /(a*|b*)[cd]/I
  5952. Capture group count = 1
  5953. Starting code units: a b c d
  5954. Subject length lower bound = 1
  5955. /(a+|b*)[cd]/I
  5956. Capture group count = 1
  5957. Starting code units: a b c d
  5958. Subject length lower bound = 1
  5959. /(a*|b+)[cd]/I
  5960. Capture group count = 1
  5961. Starting code units: a b c d
  5962. Subject length lower bound = 1
  5963. /(a+|b+)[cd]/I
  5964. Capture group count = 1
  5965. Starting code units: a b
  5966. Subject length lower bound = 2
  5967. /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  5968. ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  5969. (((
  5970. a
  5971. ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  5972. ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  5973. )))
  5974. /Ix
  5975. Capture group count = 203
  5976. Options: extended
  5977. First code unit = 'a'
  5978. Subject length lower bound = 1
  5979. large nest
  5980. Matched, but too many substrings
  5981. 0: a
  5982. 1: a
  5983. 2: a
  5984. 3: a
  5985. 4: a
  5986. 5: a
  5987. 6: a
  5988. 7: a
  5989. 8: a
  5990. 9: a
  5991. 10: a
  5992. 11: a
  5993. 12: a
  5994. 13: a
  5995. 14: a
  5996. /a*\d/B
  5997. ------------------------------------------------------------------
  5998. Bra
  5999. a*+
  6000. \d
  6001. Ket
  6002. End
  6003. ------------------------------------------------------------------
  6004. /a*\D/B
  6005. ------------------------------------------------------------------
  6006. Bra
  6007. a*
  6008. \D
  6009. Ket
  6010. End
  6011. ------------------------------------------------------------------
  6012. /0*\d/B
  6013. ------------------------------------------------------------------
  6014. Bra
  6015. 0*
  6016. \d
  6017. Ket
  6018. End
  6019. ------------------------------------------------------------------
  6020. /0*\D/B
  6021. ------------------------------------------------------------------
  6022. Bra
  6023. 0*+
  6024. \D
  6025. Ket
  6026. End
  6027. ------------------------------------------------------------------
  6028. /a*\s/B
  6029. ------------------------------------------------------------------
  6030. Bra
  6031. a*+
  6032. \s
  6033. Ket
  6034. End
  6035. ------------------------------------------------------------------
  6036. /a*\S/B
  6037. ------------------------------------------------------------------
  6038. Bra
  6039. a*
  6040. \S
  6041. Ket
  6042. End
  6043. ------------------------------------------------------------------
  6044. / *\s/B
  6045. ------------------------------------------------------------------
  6046. Bra
  6047. *
  6048. \s
  6049. Ket
  6050. End
  6051. ------------------------------------------------------------------
  6052. / *\S/B
  6053. ------------------------------------------------------------------
  6054. Bra
  6055. *+
  6056. \S
  6057. Ket
  6058. End
  6059. ------------------------------------------------------------------
  6060. /a*\w/B
  6061. ------------------------------------------------------------------
  6062. Bra
  6063. a*
  6064. \w
  6065. Ket
  6066. End
  6067. ------------------------------------------------------------------
  6068. /a*\W/B
  6069. ------------------------------------------------------------------
  6070. Bra
  6071. a*+
  6072. \W
  6073. Ket
  6074. End
  6075. ------------------------------------------------------------------
  6076. /=*\w/B
  6077. ------------------------------------------------------------------
  6078. Bra
  6079. =*+
  6080. \w
  6081. Ket
  6082. End
  6083. ------------------------------------------------------------------
  6084. /=*\W/B
  6085. ------------------------------------------------------------------
  6086. Bra
  6087. =*
  6088. \W
  6089. Ket
  6090. End
  6091. ------------------------------------------------------------------
  6092. /\d*a/B
  6093. ------------------------------------------------------------------
  6094. Bra
  6095. \d*+
  6096. a
  6097. Ket
  6098. End
  6099. ------------------------------------------------------------------
  6100. /\d*2/B
  6101. ------------------------------------------------------------------
  6102. Bra
  6103. \d*
  6104. 2
  6105. Ket
  6106. End
  6107. ------------------------------------------------------------------
  6108. /\d*\d/B
  6109. ------------------------------------------------------------------
  6110. Bra
  6111. \d*
  6112. \d
  6113. Ket
  6114. End
  6115. ------------------------------------------------------------------
  6116. /\d*\D/B
  6117. ------------------------------------------------------------------
  6118. Bra
  6119. \d*+
  6120. \D
  6121. Ket
  6122. End
  6123. ------------------------------------------------------------------
  6124. /\d*\s/B
  6125. ------------------------------------------------------------------
  6126. Bra
  6127. \d*+
  6128. \s
  6129. Ket
  6130. End
  6131. ------------------------------------------------------------------
  6132. /\d*\S/B
  6133. ------------------------------------------------------------------
  6134. Bra
  6135. \d*
  6136. \S
  6137. Ket
  6138. End
  6139. ------------------------------------------------------------------
  6140. /\d*\w/B
  6141. ------------------------------------------------------------------
  6142. Bra
  6143. \d*
  6144. \w
  6145. Ket
  6146. End
  6147. ------------------------------------------------------------------
  6148. /\d*\W/B
  6149. ------------------------------------------------------------------
  6150. Bra
  6151. \d*+
  6152. \W
  6153. Ket
  6154. End
  6155. ------------------------------------------------------------------
  6156. /\D*a/B
  6157. ------------------------------------------------------------------
  6158. Bra
  6159. \D*
  6160. a
  6161. Ket
  6162. End
  6163. ------------------------------------------------------------------
  6164. /\D*2/B
  6165. ------------------------------------------------------------------
  6166. Bra
  6167. \D*+
  6168. 2
  6169. Ket
  6170. End
  6171. ------------------------------------------------------------------
  6172. /\D*\d/B
  6173. ------------------------------------------------------------------
  6174. Bra
  6175. \D*+
  6176. \d
  6177. Ket
  6178. End
  6179. ------------------------------------------------------------------
  6180. /\D*\D/B
  6181. ------------------------------------------------------------------
  6182. Bra
  6183. \D*
  6184. \D
  6185. Ket
  6186. End
  6187. ------------------------------------------------------------------
  6188. /\D*\s/B
  6189. ------------------------------------------------------------------
  6190. Bra
  6191. \D*
  6192. \s
  6193. Ket
  6194. End
  6195. ------------------------------------------------------------------
  6196. /\D*\S/B
  6197. ------------------------------------------------------------------
  6198. Bra
  6199. \D*
  6200. \S
  6201. Ket
  6202. End
  6203. ------------------------------------------------------------------
  6204. /\D*\w/B
  6205. ------------------------------------------------------------------
  6206. Bra
  6207. \D*
  6208. \w
  6209. Ket
  6210. End
  6211. ------------------------------------------------------------------
  6212. /\D*\W/B
  6213. ------------------------------------------------------------------
  6214. Bra
  6215. \D*
  6216. \W
  6217. Ket
  6218. End
  6219. ------------------------------------------------------------------
  6220. /\s*a/B
  6221. ------------------------------------------------------------------
  6222. Bra
  6223. \s*+
  6224. a
  6225. Ket
  6226. End
  6227. ------------------------------------------------------------------
  6228. /\s*2/B
  6229. ------------------------------------------------------------------
  6230. Bra
  6231. \s*+
  6232. 2
  6233. Ket
  6234. End
  6235. ------------------------------------------------------------------
  6236. /\s*\d/B
  6237. ------------------------------------------------------------------
  6238. Bra
  6239. \s*+
  6240. \d
  6241. Ket
  6242. End
  6243. ------------------------------------------------------------------
  6244. /\s*\D/B
  6245. ------------------------------------------------------------------
  6246. Bra
  6247. \s*
  6248. \D
  6249. Ket
  6250. End
  6251. ------------------------------------------------------------------
  6252. /\s*\s/B
  6253. ------------------------------------------------------------------
  6254. Bra
  6255. \s*
  6256. \s
  6257. Ket
  6258. End
  6259. ------------------------------------------------------------------
  6260. /\s*\S/B
  6261. ------------------------------------------------------------------
  6262. Bra
  6263. \s*+
  6264. \S
  6265. Ket
  6266. End
  6267. ------------------------------------------------------------------
  6268. /\s*\w/B
  6269. ------------------------------------------------------------------
  6270. Bra
  6271. \s*+
  6272. \w
  6273. Ket
  6274. End
  6275. ------------------------------------------------------------------
  6276. /\s*\W/B
  6277. ------------------------------------------------------------------
  6278. Bra
  6279. \s*
  6280. \W
  6281. Ket
  6282. End
  6283. ------------------------------------------------------------------
  6284. /\S*a/B
  6285. ------------------------------------------------------------------
  6286. Bra
  6287. \S*
  6288. a
  6289. Ket
  6290. End
  6291. ------------------------------------------------------------------
  6292. /\S*2/B
  6293. ------------------------------------------------------------------
  6294. Bra
  6295. \S*
  6296. 2
  6297. Ket
  6298. End
  6299. ------------------------------------------------------------------
  6300. /\S*\d/B
  6301. ------------------------------------------------------------------
  6302. Bra
  6303. \S*
  6304. \d
  6305. Ket
  6306. End
  6307. ------------------------------------------------------------------
  6308. /\S*\D/B
  6309. ------------------------------------------------------------------
  6310. Bra
  6311. \S*
  6312. \D
  6313. Ket
  6314. End
  6315. ------------------------------------------------------------------
  6316. /\S*\s/B
  6317. ------------------------------------------------------------------
  6318. Bra
  6319. \S*+
  6320. \s
  6321. Ket
  6322. End
  6323. ------------------------------------------------------------------
  6324. /\S*\S/B
  6325. ------------------------------------------------------------------
  6326. Bra
  6327. \S*
  6328. \S
  6329. Ket
  6330. End
  6331. ------------------------------------------------------------------
  6332. /\S*\w/B
  6333. ------------------------------------------------------------------
  6334. Bra
  6335. \S*
  6336. \w
  6337. Ket
  6338. End
  6339. ------------------------------------------------------------------
  6340. /\S*\W/B
  6341. ------------------------------------------------------------------
  6342. Bra
  6343. \S*
  6344. \W
  6345. Ket
  6346. End
  6347. ------------------------------------------------------------------
  6348. /\w*a/B
  6349. ------------------------------------------------------------------
  6350. Bra
  6351. \w*
  6352. a
  6353. Ket
  6354. End
  6355. ------------------------------------------------------------------
  6356. /\w*2/B
  6357. ------------------------------------------------------------------
  6358. Bra
  6359. \w*
  6360. 2
  6361. Ket
  6362. End
  6363. ------------------------------------------------------------------
  6364. /\w*\d/B
  6365. ------------------------------------------------------------------
  6366. Bra
  6367. \w*
  6368. \d
  6369. Ket
  6370. End
  6371. ------------------------------------------------------------------
  6372. /\w*\D/B
  6373. ------------------------------------------------------------------
  6374. Bra
  6375. \w*
  6376. \D
  6377. Ket
  6378. End
  6379. ------------------------------------------------------------------
  6380. /\w*\s/B
  6381. ------------------------------------------------------------------
  6382. Bra
  6383. \w*+
  6384. \s
  6385. Ket
  6386. End
  6387. ------------------------------------------------------------------
  6388. /\w*\S/B
  6389. ------------------------------------------------------------------
  6390. Bra
  6391. \w*
  6392. \S
  6393. Ket
  6394. End
  6395. ------------------------------------------------------------------
  6396. /\w*\w/B
  6397. ------------------------------------------------------------------
  6398. Bra
  6399. \w*
  6400. \w
  6401. Ket
  6402. End
  6403. ------------------------------------------------------------------
  6404. /\w*\W/B
  6405. ------------------------------------------------------------------
  6406. Bra
  6407. \w*+
  6408. \W
  6409. Ket
  6410. End
  6411. ------------------------------------------------------------------
  6412. /\W*a/B
  6413. ------------------------------------------------------------------
  6414. Bra
  6415. \W*+
  6416. a
  6417. Ket
  6418. End
  6419. ------------------------------------------------------------------
  6420. /\W*2/B
  6421. ------------------------------------------------------------------
  6422. Bra
  6423. \W*+
  6424. 2
  6425. Ket
  6426. End
  6427. ------------------------------------------------------------------
  6428. /\W*\d/B
  6429. ------------------------------------------------------------------
  6430. Bra
  6431. \W*+
  6432. \d
  6433. Ket
  6434. End
  6435. ------------------------------------------------------------------
  6436. /\W*\D/B
  6437. ------------------------------------------------------------------
  6438. Bra
  6439. \W*
  6440. \D
  6441. Ket
  6442. End
  6443. ------------------------------------------------------------------
  6444. /\W*\s/B
  6445. ------------------------------------------------------------------
  6446. Bra
  6447. \W*
  6448. \s
  6449. Ket
  6450. End
  6451. ------------------------------------------------------------------
  6452. /\W*\S/B
  6453. ------------------------------------------------------------------
  6454. Bra
  6455. \W*
  6456. \S
  6457. Ket
  6458. End
  6459. ------------------------------------------------------------------
  6460. /\W*\w/B
  6461. ------------------------------------------------------------------
  6462. Bra
  6463. \W*+
  6464. \w
  6465. Ket
  6466. End
  6467. ------------------------------------------------------------------
  6468. /\W*\W/B
  6469. ------------------------------------------------------------------
  6470. Bra
  6471. \W*
  6472. \W
  6473. Ket
  6474. End
  6475. ------------------------------------------------------------------
  6476. /[^a]+a/B
  6477. ------------------------------------------------------------------
  6478. Bra
  6479. [^a]++
  6480. a
  6481. Ket
  6482. End
  6483. ------------------------------------------------------------------
  6484. /[^a]+a/Bi
  6485. ------------------------------------------------------------------
  6486. Bra
  6487. /i [^a]++
  6488. /i a
  6489. Ket
  6490. End
  6491. ------------------------------------------------------------------
  6492. /[^a]+A/Bi
  6493. ------------------------------------------------------------------
  6494. Bra
  6495. /i [^a]++
  6496. /i A
  6497. Ket
  6498. End
  6499. ------------------------------------------------------------------
  6500. /[^a]+b/B
  6501. ------------------------------------------------------------------
  6502. Bra
  6503. [^a]+
  6504. b
  6505. Ket
  6506. End
  6507. ------------------------------------------------------------------
  6508. /[^a]+\d/B
  6509. ------------------------------------------------------------------
  6510. Bra
  6511. [^a]+
  6512. \d
  6513. Ket
  6514. End
  6515. ------------------------------------------------------------------
  6516. /a*[^a]/B
  6517. ------------------------------------------------------------------
  6518. Bra
  6519. a*+
  6520. [^a]
  6521. Ket
  6522. End
  6523. ------------------------------------------------------------------
  6524. /(?P<abc>x)(?P<xyz>y)/I
  6525. Capture group count = 2
  6526. Named capture groups:
  6527. abc 1
  6528. xyz 2
  6529. First code unit = 'x'
  6530. Last code unit = 'y'
  6531. Subject length lower bound = 2
  6532. xy\=copy=abc,copy=xyz
  6533. 0: xy
  6534. 1: x
  6535. 2: y
  6536. C x (1) abc (group 1)
  6537. C y (1) xyz (group 2)
  6538. /(?<abc>x)(?'xyz'y)/I
  6539. Capture group count = 2
  6540. Named capture groups:
  6541. abc 1
  6542. xyz 2
  6543. First code unit = 'x'
  6544. Last code unit = 'y'
  6545. Subject length lower bound = 2
  6546. xy\=copy=abc,copy=xyz
  6547. 0: xy
  6548. 1: x
  6549. 2: y
  6550. C x (1) abc (group 1)
  6551. C y (1) xyz (group 2)
  6552. /(?<abc'x)(?'xyz'y)/I
  6553. Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
  6554. /(?<abc>x)(?'xyz>y)/I
  6555. Failed: error 142 at offset 15: syntax error in subpattern name (missing terminator?)
  6556. /(?P'abc'x)(?P<xyz>y)/I
  6557. Failed: error 141 at offset 3: unrecognized character after (?P
  6558. /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
  6559. bXaX
  6560. 0: bXaX
  6561. 1: X
  6562. bXbX
  6563. 0: bX
  6564. 1: X
  6565. \= Expect no match
  6566. aXaX
  6567. No match
  6568. aXbX
  6569. No match
  6570. /^(?P>abc)(?<abcd>xxx)/
  6571. Failed: error 115 at offset 5: reference to non-existent subpattern
  6572. /^(?P>abc)(?<abc>x|y)/
  6573. xx
  6574. 0: xx
  6575. 1: x
  6576. xy
  6577. 0: xy
  6578. 1: y
  6579. yy
  6580. 0: yy
  6581. 1: y
  6582. yx
  6583. 0: yx
  6584. 1: x
  6585. /^(?P>abc)(?P<abc>x|y)/
  6586. xx
  6587. 0: xx
  6588. 1: x
  6589. xy
  6590. 0: xy
  6591. 1: y
  6592. yy
  6593. 0: yy
  6594. 1: y
  6595. yx
  6596. 0: yx
  6597. 1: x
  6598. /^((?(abc)a|b)(?<abc>x|y))+/
  6599. bxay
  6600. 0: bxay
  6601. 1: ay
  6602. 2: y
  6603. bxby
  6604. 0: bx
  6605. 1: bx
  6606. 2: x
  6607. \= Expect no match
  6608. axby
  6609. No match
  6610. /^(((?P=abc)|X)(?<abc>x|y))+/
  6611. XxXxxx
  6612. 0: XxXxxx
  6613. 1: xx
  6614. 2: x
  6615. 3: x
  6616. XxXyyx
  6617. 0: XxXyyx
  6618. 1: yx
  6619. 2: y
  6620. 3: x
  6621. XxXyxx
  6622. 0: XxXy
  6623. 1: Xy
  6624. 2: X
  6625. 3: y
  6626. \= Expect no match
  6627. x
  6628. No match
  6629. /^(?1)(abc)/
  6630. abcabc
  6631. 0: abcabc
  6632. 1: abc
  6633. /^(?:(?:\1|X)(a|b))+/
  6634. Xaaa
  6635. 0: Xaaa
  6636. 1: a
  6637. Xaba
  6638. 0: Xa
  6639. 1: a
  6640. /^[\E\Qa\E-\Qz\E]+/B
  6641. ------------------------------------------------------------------
  6642. Bra
  6643. ^
  6644. [a-z]++
  6645. Ket
  6646. End
  6647. ------------------------------------------------------------------
  6648. /^[a\Q]bc\E]/B
  6649. ------------------------------------------------------------------
  6650. Bra
  6651. ^
  6652. [\]a-c]
  6653. Ket
  6654. End
  6655. ------------------------------------------------------------------
  6656. /^[a-\Q\E]/B
  6657. ------------------------------------------------------------------
  6658. Bra
  6659. ^
  6660. [\-a]
  6661. Ket
  6662. End
  6663. ------------------------------------------------------------------
  6664. /^(?P>abc)[()](?<abc>)/B
  6665. ------------------------------------------------------------------
  6666. Bra
  6667. ^
  6668. Recurse
  6669. [()]
  6670. CBra 1
  6671. Ket
  6672. Ket
  6673. End
  6674. ------------------------------------------------------------------
  6675. /^((?(abc)y)[()](?P<abc>x))+/B
  6676. ------------------------------------------------------------------
  6677. Bra
  6678. ^
  6679. CBra 1
  6680. Cond
  6681. 2 Cond ref
  6682. y
  6683. Ket
  6684. [()]
  6685. CBra 2
  6686. x
  6687. Ket
  6688. KetRmax
  6689. Ket
  6690. End
  6691. ------------------------------------------------------------------
  6692. (xy)x
  6693. 0: (xy)x
  6694. 1: y)x
  6695. 2: x
  6696. /^(?P>abc)\Q()\E(?<abc>)/B
  6697. ------------------------------------------------------------------
  6698. Bra
  6699. ^
  6700. Recurse
  6701. ()
  6702. CBra 1
  6703. Ket
  6704. Ket
  6705. End
  6706. ------------------------------------------------------------------
  6707. /^(?P>abc)[a\Q(]\E(](?<abc>)/B
  6708. ------------------------------------------------------------------
  6709. Bra
  6710. ^
  6711. Recurse
  6712. [(\]a]
  6713. CBra 1
  6714. Ket
  6715. Ket
  6716. End
  6717. ------------------------------------------------------------------
  6718. /^(?P>abc) # this is (a comment)
  6719. (?<abc>)/Bx
  6720. ------------------------------------------------------------------
  6721. Bra
  6722. ^
  6723. Recurse
  6724. CBra 1
  6725. Ket
  6726. Ket
  6727. End
  6728. ------------------------------------------------------------------
  6729. /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
  6730. Capture group count = 4
  6731. Max back reference = 4
  6732. Named capture groups:
  6733. four 4
  6734. one 1
  6735. three 3
  6736. two 2
  6737. May match empty string
  6738. Compile options: caseless
  6739. Overall options: anchored caseless
  6740. Subject length lower bound = 0
  6741. 1221
  6742. 0: 1221
  6743. 1: 1221
  6744. 2: 1
  6745. Satan, oscillate my metallic sonatas!
  6746. 0: Satan, oscillate my metallic sonatas!
  6747. 1: <unset>
  6748. 2: <unset>
  6749. 3: Satan, oscillate my metallic sonatas
  6750. 4: S
  6751. A man, a plan, a canal: Panama!
  6752. 0: A man, a plan, a canal: Panama!
  6753. 1: <unset>
  6754. 2: <unset>
  6755. 3: A man, a plan, a canal: Panama
  6756. 4: A
  6757. Able was I ere I saw Elba.
  6758. 0: Able was I ere I saw Elba.
  6759. 1: <unset>
  6760. 2: <unset>
  6761. 3: Able was I ere I saw Elba
  6762. 4: A
  6763. \= Expect no match
  6764. The quick brown fox
  6765. No match
  6766. /(?=(\w+))\1:/I
  6767. Capture group count = 1
  6768. Max back reference = 1
  6769. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  6770. Q R S T U V W X Y Z _ 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
  6771. Last code unit = ':'
  6772. Subject length lower bound = 2
  6773. abcd:
  6774. 0: abcd:
  6775. 1: abcd
  6776. /(?=(?'abc'\w+))\k<abc>:/I
  6777. Capture group count = 1
  6778. Max back reference = 1
  6779. Named capture groups:
  6780. abc 1
  6781. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  6782. Q R S T U V W X Y Z _ 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
  6783. Last code unit = ':'
  6784. Subject length lower bound = 2
  6785. abcd:
  6786. 0: abcd:
  6787. 1: abcd
  6788. /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/dupnames
  6789. adaa
  6790. 0: adaa
  6791. 1: a
  6792. 2: d
  6793. \= Expect no match
  6794. addd
  6795. No match
  6796. adbb
  6797. No match
  6798. /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/dupnames
  6799. bdaa
  6800. 0: bdaa
  6801. 1: b
  6802. 2: d
  6803. bdab
  6804. 0: bdab
  6805. 1: b
  6806. 2: d
  6807. \= Expect no match
  6808. bddd
  6809. No match
  6810. /(?(<bc))/
  6811. Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
  6812. /(?(''))/
  6813. Failed: error 162 at offset 4: subpattern name expected
  6814. /(?('R')stuff)/
  6815. Failed: error 115 at offset 4: reference to non-existent subpattern
  6816. /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
  6817. abcabc1Xabc2XabcXabcabc
  6818. 0: abcabc1Xabc2XabcX
  6819. 1: abcabc1Xabc2XabcX
  6820. 2: abcabc1Xabc2XabcX
  6821. /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
  6822. abcabc1Xabc2XabcXabcabc
  6823. 0: abcabc1Xabc2XabcX
  6824. 1: abcabc1Xabc2XabcX
  6825. 2: abcabc1Xabc2XabcX
  6826. /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
  6827. Failed: error 115 at offset 27: reference to non-existent subpattern
  6828. /^(?(DEFINE) abc | xyz ) /x
  6829. Failed: error 154 at offset 4: DEFINE subpattern contains more than one branch
  6830. /(?(DEFINE) abc) xyz/Ix
  6831. Capture group count = 0
  6832. Options: extended
  6833. First code unit = 'x'
  6834. Last code unit = 'z'
  6835. Subject length lower bound = 3
  6836. /(a|)*\d/
  6837. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
  6838. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  6839. 1:
  6840. \= Expect no match
  6841. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
  6842. No match
  6843. /^a.b/newline=lf
  6844. a\rb
  6845. 0: a\x0db
  6846. \= Expect no match
  6847. a\nb
  6848. No match
  6849. /^a.b/newline=cr
  6850. a\nb
  6851. 0: a\x0ab
  6852. \= Expect no match
  6853. a\rb
  6854. No match
  6855. /^a.b/newline=anycrlf
  6856. a\x85b
  6857. 0: a\x85b
  6858. \= Expect no match
  6859. a\rb
  6860. No match
  6861. /^a.b/newline=any
  6862. \= Expect no match
  6863. a\nb
  6864. No match
  6865. a\rb
  6866. No match
  6867. a\x85b
  6868. No match
  6869. /^abc./gmx,newline=any
  6870. abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
  6871. 0: abc1
  6872. 0: abc2
  6873. 0: abc3
  6874. 0: abc4
  6875. 0: abc5
  6876. 0: abc6
  6877. 0: abc7
  6878. /abc.$/gmx,newline=any
  6879. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
  6880. 0: abc1
  6881. 0: abc2
  6882. 0: abc3
  6883. 0: abc4
  6884. 0: abc5
  6885. 0: abc6
  6886. 0: abc9
  6887. /^a\Rb/bsr=unicode
  6888. a\nb
  6889. 0: a\x0ab
  6890. a\rb
  6891. 0: a\x0db
  6892. a\r\nb
  6893. 0: a\x0d\x0ab
  6894. a\x0bb
  6895. 0: a\x0bb
  6896. a\x0cb
  6897. 0: a\x0cb
  6898. a\x85b
  6899. 0: a\x85b
  6900. \= Expect no match
  6901. a\n\rb
  6902. No match
  6903. /^a\R*b/bsr=unicode
  6904. ab
  6905. 0: ab
  6906. a\nb
  6907. 0: a\x0ab
  6908. a\rb
  6909. 0: a\x0db
  6910. a\r\nb
  6911. 0: a\x0d\x0ab
  6912. a\x0bb
  6913. 0: a\x0bb
  6914. a\x0cb
  6915. 0: a\x0cb
  6916. a\x85b
  6917. 0: a\x85b
  6918. a\n\rb
  6919. 0: a\x0a\x0db
  6920. a\n\r\x85\x0cb
  6921. 0: a\x0a\x0d\x85\x0cb
  6922. /^a\R+b/bsr=unicode
  6923. a\nb
  6924. 0: a\x0ab
  6925. a\rb
  6926. 0: a\x0db
  6927. a\r\nb
  6928. 0: a\x0d\x0ab
  6929. a\x0bb
  6930. 0: a\x0bb
  6931. a\x0cb
  6932. 0: a\x0cb
  6933. a\x85b
  6934. 0: a\x85b
  6935. a\n\rb
  6936. 0: a\x0a\x0db
  6937. a\n\r\x85\x0cb
  6938. 0: a\x0a\x0d\x85\x0cb
  6939. \= Expect no match
  6940. ab
  6941. No match
  6942. /^a\R{1,3}b/bsr=unicode
  6943. a\nb
  6944. 0: a\x0ab
  6945. a\n\rb
  6946. 0: a\x0a\x0db
  6947. a\n\r\x85b
  6948. 0: a\x0a\x0d\x85b
  6949. a\r\n\r\nb
  6950. 0: a\x0d\x0a\x0d\x0ab
  6951. a\r\n\r\n\r\nb
  6952. 0: a\x0d\x0a\x0d\x0a\x0d\x0ab
  6953. a\n\r\n\rb
  6954. 0: a\x0a\x0d\x0a\x0db
  6955. a\n\n\r\nb
  6956. 0: a\x0a\x0a\x0d\x0ab
  6957. \= Expect no match
  6958. a\n\n\n\rb
  6959. No match
  6960. a\r
  6961. No match
  6962. /(?&abc)X(?<abc>P)/I
  6963. Capture group count = 1
  6964. Named capture groups:
  6965. abc 1
  6966. Last code unit = 'P'
  6967. Subject length lower bound = 3
  6968. abcPXP123
  6969. 0: PXP
  6970. 1: P
  6971. /(?1)X(?<abc>P)/I
  6972. Capture group count = 1
  6973. Named capture groups:
  6974. abc 1
  6975. Last code unit = 'P'
  6976. Subject length lower bound = 3
  6977. abcPXP123
  6978. 0: PXP
  6979. 1: P
  6980. /(?:a(?&abc)b)*(?<abc>x)/
  6981. 123axbaxbaxbx456
  6982. 0: axbaxbaxbx
  6983. 1: x
  6984. 123axbaxbaxb456
  6985. 0: x
  6986. 1: x
  6987. /(?:a(?&abc)b){1,5}(?<abc>x)/
  6988. 123axbaxbaxbx456
  6989. 0: axbaxbaxbx
  6990. 1: x
  6991. /(?:a(?&abc)b){2,5}(?<abc>x)/
  6992. 123axbaxbaxbx456
  6993. 0: axbaxbaxbx
  6994. 1: x
  6995. /(?:a(?&abc)b){2,}(?<abc>x)/
  6996. 123axbaxbaxbx456
  6997. 0: axbaxbaxbx
  6998. 1: x
  6999. /(abc)(?i:(?1))/
  7000. defabcabcxyz
  7001. 0: abcabc
  7002. 1: abc
  7003. \= Expect no match
  7004. DEFabcABCXYZ
  7005. No match
  7006. /(abc)(?:(?i)(?1))/
  7007. defabcabcxyz
  7008. 0: abcabc
  7009. 1: abc
  7010. \= Expect no match
  7011. DEFabcABCXYZ
  7012. No match
  7013. /^(a)\g-2/
  7014. Failed: error 115 at offset 8: reference to non-existent subpattern
  7015. /^(a)\g/
  7016. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7017. /^(a)\g{0}/
  7018. Failed: error 115 at offset 9: reference to non-existent subpattern
  7019. /^(a)\g{3/
  7020. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7021. /^(a)\g{aa}/
  7022. Failed: error 115 at offset 7: reference to non-existent subpattern
  7023. /^a.b/newline=lf
  7024. a\rb
  7025. 0: a\x0db
  7026. \= Expect no match
  7027. a\nb
  7028. No match
  7029. /.+foo/
  7030. afoo
  7031. 0: afoo
  7032. \= Expect no match
  7033. \r\nfoo
  7034. No match
  7035. \nfoo
  7036. No match
  7037. /.+foo/newline=crlf
  7038. afoo
  7039. 0: afoo
  7040. \nfoo
  7041. 0: \x0afoo
  7042. \= Expect no match
  7043. \r\nfoo
  7044. No match
  7045. /.+foo/newline=any
  7046. afoo
  7047. 0: afoo
  7048. \= Expect no match
  7049. \nfoo
  7050. No match
  7051. \r\nfoo
  7052. No match
  7053. /.+foo/s
  7054. afoo
  7055. 0: afoo
  7056. \r\nfoo
  7057. 0: \x0d\x0afoo
  7058. \nfoo
  7059. 0: \x0afoo
  7060. /^$/gm,newline=any
  7061. abc\r\rxyz
  7062. 0:
  7063. abc\n\rxyz
  7064. 0:
  7065. \= Expect no match
  7066. abc\r\nxyz
  7067. No match
  7068. /(?m)^$/g,newline=any,aftertext
  7069. abc\r\n\r\n
  7070. 0:
  7071. 0+ \x0d\x0a
  7072. /(?m)^$|^\r\n/g,newline=any,aftertext
  7073. abc\r\n\r\n
  7074. 0:
  7075. 0+ \x0d\x0a
  7076. 0: \x0d\x0a
  7077. 0+
  7078. /(?m)$/g,newline=any,aftertext
  7079. abc\r\n\r\n
  7080. 0:
  7081. 0+ \x0d\x0a\x0d\x0a
  7082. 0:
  7083. 0+ \x0d\x0a
  7084. 0:
  7085. 0+
  7086. /abc.$/gmx,newline=anycrlf
  7087. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
  7088. 0: abc1
  7089. 0: abc4
  7090. 0: abc5
  7091. 0: abc9
  7092. /^X/m
  7093. XABC
  7094. 0: X
  7095. \= Expect no match
  7096. XABC\=notbol
  7097. No match
  7098. /(ab|c)(?-1)/B
  7099. ------------------------------------------------------------------
  7100. Bra
  7101. CBra 1
  7102. ab
  7103. Alt
  7104. c
  7105. Ket
  7106. Recurse
  7107. Ket
  7108. End
  7109. ------------------------------------------------------------------
  7110. abc
  7111. 0: abc
  7112. 1: ab
  7113. /xy(?+1)(abc)/B
  7114. ------------------------------------------------------------------
  7115. Bra
  7116. xy
  7117. Recurse
  7118. CBra 1
  7119. abc
  7120. Ket
  7121. Ket
  7122. End
  7123. ------------------------------------------------------------------
  7124. xyabcabc
  7125. 0: xyabcabc
  7126. 1: abc
  7127. \= Expect no match
  7128. xyabc
  7129. No match
  7130. /x(?-0)y/
  7131. Failed: error 126 at offset 5: a relative value of zero is not allowed
  7132. /x(?-1)y/
  7133. Failed: error 115 at offset 5: reference to non-existent subpattern
  7134. /x(?+0)y/
  7135. Failed: error 126 at offset 5: a relative value of zero is not allowed
  7136. /x(?+1)y/
  7137. Failed: error 115 at offset 5: reference to non-existent subpattern
  7138. /^(abc)?(?(-1)X|Y)/B
  7139. ------------------------------------------------------------------
  7140. Bra
  7141. ^
  7142. Brazero
  7143. CBra 1
  7144. abc
  7145. Ket
  7146. Cond
  7147. 1 Cond ref
  7148. X
  7149. Alt
  7150. Y
  7151. Ket
  7152. Ket
  7153. End
  7154. ------------------------------------------------------------------
  7155. abcX
  7156. 0: abcX
  7157. 1: abc
  7158. Y
  7159. 0: Y
  7160. \= Expect no match
  7161. abcY
  7162. No match
  7163. /^((?(+1)X|Y)(abc))+/B
  7164. ------------------------------------------------------------------
  7165. Bra
  7166. ^
  7167. CBra 1
  7168. Cond
  7169. 2 Cond ref
  7170. X
  7171. Alt
  7172. Y
  7173. Ket
  7174. CBra 2
  7175. abc
  7176. Ket
  7177. KetRmax
  7178. Ket
  7179. End
  7180. ------------------------------------------------------------------
  7181. YabcXabc
  7182. 0: YabcXabc
  7183. 1: Xabc
  7184. 2: abc
  7185. YabcXabcXabc
  7186. 0: YabcXabcXabc
  7187. 1: Xabc
  7188. 2: abc
  7189. \= Expect no match
  7190. XabcXabc
  7191. No match
  7192. /(?(-1)a)/B
  7193. Failed: error 115 at offset 5: reference to non-existent subpattern
  7194. /((?(-1)a))/B
  7195. ------------------------------------------------------------------
  7196. Bra
  7197. CBra 1
  7198. Cond
  7199. 1 Cond ref
  7200. a
  7201. Ket
  7202. Ket
  7203. Ket
  7204. End
  7205. ------------------------------------------------------------------
  7206. /((?(-2)a))/B
  7207. Failed: error 115 at offset 6: reference to non-existent subpattern
  7208. /^(?(+1)X|Y)(.)/B
  7209. ------------------------------------------------------------------
  7210. Bra
  7211. ^
  7212. Cond
  7213. 1 Cond ref
  7214. X
  7215. Alt
  7216. Y
  7217. Ket
  7218. CBra 1
  7219. Any
  7220. Ket
  7221. Ket
  7222. End
  7223. ------------------------------------------------------------------
  7224. Y!
  7225. 0: Y!
  7226. 1: !
  7227. /(?<A>tom|bon)-\k{A}/
  7228. tom-tom
  7229. 0: tom-tom
  7230. 1: tom
  7231. bon-bon
  7232. 0: bon-bon
  7233. 1: bon
  7234. \= Expect no match
  7235. tom-bon
  7236. No match
  7237. /\g{A/
  7238. Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
  7239. /(?|(abc)|(xyz))/B
  7240. ------------------------------------------------------------------
  7241. Bra
  7242. Bra
  7243. CBra 1
  7244. abc
  7245. Ket
  7246. Alt
  7247. CBra 1
  7248. xyz
  7249. Ket
  7250. Ket
  7251. Ket
  7252. End
  7253. ------------------------------------------------------------------
  7254. >abc<
  7255. 0: abc
  7256. 1: abc
  7257. >xyz<
  7258. 0: xyz
  7259. 1: xyz
  7260. /(x)(?|(abc)|(xyz))(x)/B
  7261. ------------------------------------------------------------------
  7262. Bra
  7263. CBra 1
  7264. x
  7265. Ket
  7266. Bra
  7267. CBra 2
  7268. abc
  7269. Ket
  7270. Alt
  7271. CBra 2
  7272. xyz
  7273. Ket
  7274. Ket
  7275. CBra 3
  7276. x
  7277. Ket
  7278. Ket
  7279. End
  7280. ------------------------------------------------------------------
  7281. xabcx
  7282. 0: xabcx
  7283. 1: x
  7284. 2: abc
  7285. 3: x
  7286. xxyzx
  7287. 0: xxyzx
  7288. 1: x
  7289. 2: xyz
  7290. 3: x
  7291. /(x)(?|(abc)(pqr)|(xyz))(x)/B
  7292. ------------------------------------------------------------------
  7293. Bra
  7294. CBra 1
  7295. x
  7296. Ket
  7297. Bra
  7298. CBra 2
  7299. abc
  7300. Ket
  7301. CBra 3
  7302. pqr
  7303. Ket
  7304. Alt
  7305. CBra 2
  7306. xyz
  7307. Ket
  7308. Ket
  7309. CBra 4
  7310. x
  7311. Ket
  7312. Ket
  7313. End
  7314. ------------------------------------------------------------------
  7315. xabcpqrx
  7316. 0: xabcpqrx
  7317. 1: x
  7318. 2: abc
  7319. 3: pqr
  7320. 4: x
  7321. xxyzx
  7322. 0: xxyzx
  7323. 1: x
  7324. 2: xyz
  7325. 3: <unset>
  7326. 4: x
  7327. /\H++X/B
  7328. ------------------------------------------------------------------
  7329. Bra
  7330. \H++
  7331. X
  7332. Ket
  7333. End
  7334. ------------------------------------------------------------------
  7335. \= Expect no match
  7336. XXXX
  7337. No match
  7338. /\H+\hY/B
  7339. ------------------------------------------------------------------
  7340. Bra
  7341. \H++
  7342. \h
  7343. Y
  7344. Ket
  7345. End
  7346. ------------------------------------------------------------------
  7347. XXXX Y
  7348. 0: XXXX Y
  7349. /\H+ Y/B
  7350. ------------------------------------------------------------------
  7351. Bra
  7352. \H++
  7353. Y
  7354. Ket
  7355. End
  7356. ------------------------------------------------------------------
  7357. /\h+A/B
  7358. ------------------------------------------------------------------
  7359. Bra
  7360. \h++
  7361. A
  7362. Ket
  7363. End
  7364. ------------------------------------------------------------------
  7365. /\v*B/B
  7366. ------------------------------------------------------------------
  7367. Bra
  7368. \v*+
  7369. B
  7370. Ket
  7371. End
  7372. ------------------------------------------------------------------
  7373. /\V+\x0a/B
  7374. ------------------------------------------------------------------
  7375. Bra
  7376. \V++
  7377. \x0a
  7378. Ket
  7379. End
  7380. ------------------------------------------------------------------
  7381. /A+\h/B
  7382. ------------------------------------------------------------------
  7383. Bra
  7384. A++
  7385. \h
  7386. Ket
  7387. End
  7388. ------------------------------------------------------------------
  7389. / *\H/B
  7390. ------------------------------------------------------------------
  7391. Bra
  7392. *+
  7393. \H
  7394. Ket
  7395. End
  7396. ------------------------------------------------------------------
  7397. /A*\v/B
  7398. ------------------------------------------------------------------
  7399. Bra
  7400. A*+
  7401. \v
  7402. Ket
  7403. End
  7404. ------------------------------------------------------------------
  7405. /\x0b*\V/B
  7406. ------------------------------------------------------------------
  7407. Bra
  7408. \x0b*+
  7409. \V
  7410. Ket
  7411. End
  7412. ------------------------------------------------------------------
  7413. /\d+\h/B
  7414. ------------------------------------------------------------------
  7415. Bra
  7416. \d++
  7417. \h
  7418. Ket
  7419. End
  7420. ------------------------------------------------------------------
  7421. /\d*\v/B
  7422. ------------------------------------------------------------------
  7423. Bra
  7424. \d*+
  7425. \v
  7426. Ket
  7427. End
  7428. ------------------------------------------------------------------
  7429. /S+\h\S+\v/B
  7430. ------------------------------------------------------------------
  7431. Bra
  7432. S++
  7433. \h
  7434. \S++
  7435. \v
  7436. Ket
  7437. End
  7438. ------------------------------------------------------------------
  7439. /\w{3,}\h\w+\v/B
  7440. ------------------------------------------------------------------
  7441. Bra
  7442. \w{3}
  7443. \w*+
  7444. \h
  7445. \w++
  7446. \v
  7447. Ket
  7448. End
  7449. ------------------------------------------------------------------
  7450. /\h+\d\h+\w\h+\S\h+\H/B
  7451. ------------------------------------------------------------------
  7452. Bra
  7453. \h++
  7454. \d
  7455. \h++
  7456. \w
  7457. \h++
  7458. \S
  7459. \h++
  7460. \H
  7461. Ket
  7462. End
  7463. ------------------------------------------------------------------
  7464. /\v+\d\v+\w\v+\S\v+\V/B
  7465. ------------------------------------------------------------------
  7466. Bra
  7467. \v++
  7468. \d
  7469. \v++
  7470. \w
  7471. \v++
  7472. \S
  7473. \v++
  7474. \V
  7475. Ket
  7476. End
  7477. ------------------------------------------------------------------
  7478. /\H+\h\H+\d/B
  7479. ------------------------------------------------------------------
  7480. Bra
  7481. \H++
  7482. \h
  7483. \H+
  7484. \d
  7485. Ket
  7486. End
  7487. ------------------------------------------------------------------
  7488. /\V+\v\V+\w/B
  7489. ------------------------------------------------------------------
  7490. Bra
  7491. \V++
  7492. \v
  7493. \V+
  7494. \w
  7495. Ket
  7496. End
  7497. ------------------------------------------------------------------
  7498. /\( (?: [^()]* | (?R) )* \)/x
  7499. (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)\=jitstack=1024
  7500. 0: (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
  7501. /[\E]AAA/
  7502. Failed: error 106 at offset 7: missing terminating ] for character class
  7503. /[\Q\E]AAA/
  7504. Failed: error 106 at offset 9: missing terminating ] for character class
  7505. /[^\E]AAA/
  7506. Failed: error 106 at offset 8: missing terminating ] for character class
  7507. /[^\Q\E]AAA/
  7508. Failed: error 106 at offset 10: missing terminating ] for character class
  7509. /[\E^]AAA/
  7510. Failed: error 106 at offset 8: missing terminating ] for character class
  7511. /[\Q\E^]AAA/
  7512. Failed: error 106 at offset 10: missing terminating ] for character class
  7513. /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
  7514. ------------------------------------------------------------------
  7515. Bra
  7516. A
  7517. *PRUNE
  7518. B
  7519. *SKIP
  7520. C
  7521. *THEN
  7522. D
  7523. *COMMIT
  7524. E
  7525. *FAIL
  7526. F
  7527. *FAIL
  7528. G
  7529. *FAIL
  7530. H
  7531. *ACCEPT
  7532. I
  7533. Ket
  7534. End
  7535. ------------------------------------------------------------------
  7536. /^a+(*FAIL)/auto_callout
  7537. \= Expect no match
  7538. aaaaaa
  7539. --->aaaaaa
  7540. +0 ^ ^
  7541. +1 ^ a+
  7542. +3 ^ ^ (*FAIL)
  7543. +3 ^ ^ (*FAIL)
  7544. +3 ^ ^ (*FAIL)
  7545. +3 ^ ^ (*FAIL)
  7546. +3 ^ ^ (*FAIL)
  7547. +3 ^^ (*FAIL)
  7548. No match
  7549. /a+b?c+(*FAIL)/auto_callout
  7550. \= Expect no match
  7551. aaabccc
  7552. --->aaabccc
  7553. +0 ^ a+
  7554. +2 ^ ^ b?
  7555. +4 ^ ^ c+
  7556. +6 ^ ^ (*FAIL)
  7557. +6 ^ ^ (*FAIL)
  7558. +6 ^ ^ (*FAIL)
  7559. +0 ^ a+
  7560. +2 ^ ^ b?
  7561. +4 ^ ^ c+
  7562. +6 ^ ^ (*FAIL)
  7563. +6 ^ ^ (*FAIL)
  7564. +6 ^ ^ (*FAIL)
  7565. +0 ^ a+
  7566. +2 ^^ b?
  7567. +4 ^ ^ c+
  7568. +6 ^ ^ (*FAIL)
  7569. +6 ^ ^ (*FAIL)
  7570. +6 ^ ^ (*FAIL)
  7571. No match
  7572. /a+b?(*PRUNE)c+(*FAIL)/auto_callout
  7573. \= Expect no match
  7574. aaabccc
  7575. --->aaabccc
  7576. +0 ^ a+
  7577. +2 ^ ^ b?
  7578. +4 ^ ^ (*PRUNE)
  7579. +12 ^ ^ c+
  7580. +14 ^ ^ (*FAIL)
  7581. +14 ^ ^ (*FAIL)
  7582. +14 ^ ^ (*FAIL)
  7583. +0 ^ a+
  7584. +2 ^ ^ b?
  7585. +4 ^ ^ (*PRUNE)
  7586. +12 ^ ^ c+
  7587. +14 ^ ^ (*FAIL)
  7588. +14 ^ ^ (*FAIL)
  7589. +14 ^ ^ (*FAIL)
  7590. +0 ^ a+
  7591. +2 ^^ b?
  7592. +4 ^ ^ (*PRUNE)
  7593. +12 ^ ^ c+
  7594. +14 ^ ^ (*FAIL)
  7595. +14 ^ ^ (*FAIL)
  7596. +14 ^ ^ (*FAIL)
  7597. No match
  7598. /a+b?(*COMMIT)c+(*FAIL)/auto_callout
  7599. \= Expect no match
  7600. aaabccc
  7601. --->aaabccc
  7602. +0 ^ a+
  7603. +2 ^ ^ b?
  7604. +4 ^ ^ (*COMMIT)
  7605. +13 ^ ^ c+
  7606. +15 ^ ^ (*FAIL)
  7607. +15 ^ ^ (*FAIL)
  7608. +15 ^ ^ (*FAIL)
  7609. No match
  7610. /a+b?(*SKIP)c+(*FAIL)/auto_callout
  7611. \= Expect no match
  7612. aaabcccaaabccc
  7613. --->aaabcccaaabccc
  7614. +0 ^ a+
  7615. +2 ^ ^ b?
  7616. +4 ^ ^ (*SKIP)
  7617. +11 ^ ^ c+
  7618. +13 ^ ^ (*FAIL)
  7619. +13 ^ ^ (*FAIL)
  7620. +13 ^ ^ (*FAIL)
  7621. +0 ^ a+
  7622. +2 ^ ^ b?
  7623. +4 ^ ^ (*SKIP)
  7624. +11 ^ ^ c+
  7625. +13 ^ ^ (*FAIL)
  7626. +13 ^ ^ (*FAIL)
  7627. +13 ^ ^ (*FAIL)
  7628. No match
  7629. /a+b?(*THEN)c+(*FAIL)/auto_callout
  7630. \= Expect no match
  7631. aaabccc
  7632. --->aaabccc
  7633. +0 ^ a+
  7634. +2 ^ ^ b?
  7635. +4 ^ ^ (*THEN)
  7636. +11 ^ ^ c+
  7637. +13 ^ ^ (*FAIL)
  7638. +13 ^ ^ (*FAIL)
  7639. +13 ^ ^ (*FAIL)
  7640. +0 ^ a+
  7641. +2 ^ ^ b?
  7642. +4 ^ ^ (*THEN)
  7643. +11 ^ ^ c+
  7644. +13 ^ ^ (*FAIL)
  7645. +13 ^ ^ (*FAIL)
  7646. +13 ^ ^ (*FAIL)
  7647. +0 ^ a+
  7648. +2 ^^ b?
  7649. +4 ^ ^ (*THEN)
  7650. +11 ^ ^ c+
  7651. +13 ^ ^ (*FAIL)
  7652. +13 ^ ^ (*FAIL)
  7653. +13 ^ ^ (*FAIL)
  7654. No match
  7655. /a(*MARK)b/
  7656. Failed: error 166 at offset 7: (*MARK) must have an argument
  7657. /\g6666666666/
  7658. Failed: error 161 at offset 7: subpattern number is too big
  7659. /[\g6666666666]/B
  7660. ------------------------------------------------------------------
  7661. Bra
  7662. [6g]
  7663. Ket
  7664. End
  7665. ------------------------------------------------------------------
  7666. /(?1)\c[/
  7667. Failed: error 115 at offset 3: reference to non-existent subpattern
  7668. /.+A/newline=crlf
  7669. \= Expect no match
  7670. \r\nA
  7671. No match
  7672. /\nA/newline=crlf
  7673. \r\nA
  7674. 0: \x0aA
  7675. /[\r\n]A/newline=crlf
  7676. \r\nA
  7677. 0: \x0aA
  7678. /(\r|\n)A/newline=crlf
  7679. \r\nA
  7680. 0: \x0aA
  7681. 1: \x0a
  7682. /a(*CR)b/
  7683. Failed: error 160 at offset 5: (*VERB) not recognized or malformed
  7684. /(*CR)a.b/
  7685. a\nb
  7686. 0: a\x0ab
  7687. \= Expect no match
  7688. a\rb
  7689. No match
  7690. /(*CR)a.b/newline=lf
  7691. a\nb
  7692. 0: a\x0ab
  7693. \= Expect no match
  7694. a\rb
  7695. No match
  7696. /(*LF)a.b/newline=CRLF
  7697. a\rb
  7698. 0: a\x0db
  7699. \= Expect no match
  7700. a\nb
  7701. No match
  7702. /(*CRLF)a.b/
  7703. a\rb
  7704. 0: a\x0db
  7705. a\nb
  7706. 0: a\x0ab
  7707. \= Expect no match
  7708. a\r\nb
  7709. No match
  7710. /(*ANYCRLF)a.b/newline=CR
  7711. \= Expect no match
  7712. a\rb
  7713. No match
  7714. a\nb
  7715. No match
  7716. a\r\nb
  7717. No match
  7718. /(*ANY)a.b/newline=cr
  7719. \= Expect no match
  7720. a\rb
  7721. No match
  7722. a\nb
  7723. No match
  7724. a\r\nb
  7725. No match
  7726. a\x85b
  7727. No match
  7728. /(*ANY).*/g
  7729. abc\r\ndef
  7730. 0: abc
  7731. 0:
  7732. 0: def
  7733. 0:
  7734. /(*ANYCRLF).*/g
  7735. abc\r\ndef
  7736. 0: abc
  7737. 0:
  7738. 0: def
  7739. 0:
  7740. /(*CRLF).*/g
  7741. abc\r\ndef
  7742. 0: abc
  7743. 0:
  7744. 0: def
  7745. 0:
  7746. /(*NUL)^.*/
  7747. a\nb\x00ccc
  7748. 0: a\x0ab
  7749. /(*NUL)^.*/s
  7750. a\nb\x00ccc
  7751. 0: a\x0ab\x00ccc
  7752. /^x/m,newline=NUL
  7753. ab\x00xy
  7754. 0: x
  7755. /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
  7756. x\nyz
  7757. 0: x\x0ay
  7758. /(*NUL)^X\NY/
  7759. X\nY
  7760. 0: X\x0aY
  7761. X\rY
  7762. 0: X\x0dY
  7763. \= Expect no match
  7764. X\x00Y
  7765. No match
  7766. /a\Rb/I,bsr=anycrlf
  7767. Capture group count = 0
  7768. \R matches CR, LF, or CRLF
  7769. First code unit = 'a'
  7770. Last code unit = 'b'
  7771. Subject length lower bound = 3
  7772. a\rb
  7773. 0: a\x0db
  7774. a\nb
  7775. 0: a\x0ab
  7776. a\r\nb
  7777. 0: a\x0d\x0ab
  7778. \= Expect no match
  7779. a\x85b
  7780. No match
  7781. a\x0bb
  7782. No match
  7783. /a\Rb/I,bsr=unicode
  7784. Capture group count = 0
  7785. \R matches any Unicode newline
  7786. First code unit = 'a'
  7787. Last code unit = 'b'
  7788. Subject length lower bound = 3
  7789. a\rb
  7790. 0: a\x0db
  7791. a\nb
  7792. 0: a\x0ab
  7793. a\r\nb
  7794. 0: a\x0d\x0ab
  7795. a\x85b
  7796. 0: a\x85b
  7797. a\x0bb
  7798. 0: a\x0bb
  7799. /a\R?b/I,bsr=anycrlf
  7800. Capture group count = 0
  7801. \R matches CR, LF, or CRLF
  7802. First code unit = 'a'
  7803. Last code unit = 'b'
  7804. Subject length lower bound = 2
  7805. a\rb
  7806. 0: a\x0db
  7807. a\nb
  7808. 0: a\x0ab
  7809. a\r\nb
  7810. 0: a\x0d\x0ab
  7811. \= Expect no match
  7812. a\x85b
  7813. No match
  7814. a\x0bb
  7815. No match
  7816. /a\R?b/I,bsr=unicode
  7817. Capture group count = 0
  7818. \R matches any Unicode newline
  7819. First code unit = 'a'
  7820. Last code unit = 'b'
  7821. Subject length lower bound = 2
  7822. a\rb
  7823. 0: a\x0db
  7824. a\nb
  7825. 0: a\x0ab
  7826. a\r\nb
  7827. 0: a\x0d\x0ab
  7828. a\x85b
  7829. 0: a\x85b
  7830. a\x0bb
  7831. 0: a\x0bb
  7832. /a\R{2,4}b/I,bsr=anycrlf
  7833. Capture group count = 0
  7834. \R matches CR, LF, or CRLF
  7835. First code unit = 'a'
  7836. Last code unit = 'b'
  7837. Subject length lower bound = 4
  7838. a\r\n\nb
  7839. 0: a\x0d\x0a\x0ab
  7840. a\n\r\rb
  7841. 0: a\x0a\x0d\x0db
  7842. a\r\n\r\n\r\n\r\nb
  7843. 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
  7844. \= Expect no match
  7845. a\x85\x85b
  7846. No match
  7847. a\x0b\x0bb
  7848. No match
  7849. /a\R{2,4}b/I,bsr=unicode
  7850. Capture group count = 0
  7851. \R matches any Unicode newline
  7852. First code unit = 'a'
  7853. Last code unit = 'b'
  7854. Subject length lower bound = 4
  7855. a\r\rb
  7856. 0: a\x0d\x0db
  7857. a\n\n\nb
  7858. 0: a\x0a\x0a\x0ab
  7859. a\r\n\n\r\rb
  7860. 0: a\x0d\x0a\x0a\x0d\x0db
  7861. a\x85\x85b
  7862. 0: a\x85\x85b
  7863. a\x0b\x0bb
  7864. 0: a\x0b\x0bb
  7865. \= Expect no match
  7866. a\r\r\r\r\rb
  7867. No match
  7868. /(*BSR_ANYCRLF)a\Rb/I
  7869. Capture group count = 0
  7870. \R matches CR, LF, or CRLF
  7871. First code unit = 'a'
  7872. Last code unit = 'b'
  7873. Subject length lower bound = 3
  7874. a\nb
  7875. 0: a\x0ab
  7876. a\rb
  7877. 0: a\x0db
  7878. /(*BSR_UNICODE)a\Rb/I
  7879. Capture group count = 0
  7880. \R matches any Unicode newline
  7881. First code unit = 'a'
  7882. Last code unit = 'b'
  7883. Subject length lower bound = 3
  7884. a\x85b
  7885. 0: a\x85b
  7886. /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
  7887. Capture group count = 0
  7888. \R matches CR, LF, or CRLF
  7889. Forced newline is CRLF
  7890. First code unit = 'a'
  7891. Last code unit = 'b'
  7892. Subject length lower bound = 3
  7893. a\nb
  7894. 0: a\x0ab
  7895. a\rb
  7896. 0: a\x0db
  7897. /(*CRLF)(*BSR_UNICODE)a\Rb/I
  7898. Capture group count = 0
  7899. \R matches any Unicode newline
  7900. Forced newline is CRLF
  7901. First code unit = 'a'
  7902. Last code unit = 'b'
  7903. Subject length lower bound = 3
  7904. a\x85b
  7905. 0: a\x85b
  7906. /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
  7907. Capture group count = 0
  7908. \R matches CR, LF, or CRLF
  7909. Forced newline is CR
  7910. First code unit = 'a'
  7911. Last code unit = 'b'
  7912. Subject length lower bound = 2
  7913. /(?<a>)(?&)/
  7914. Failed: error 162 at offset 9: subpattern name expected
  7915. /(?<abc>)(?&a)/
  7916. Failed: error 115 at offset 11: reference to non-existent subpattern
  7917. /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
  7918. Failed: error 115 at offset 9: reference to non-existent subpattern
  7919. /(?+-a)/
  7920. Failed: error 129 at offset 2: digit expected after (?+ or (?-
  7921. /(?-+a)/
  7922. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  7923. /(?(-1))/
  7924. Failed: error 115 at offset 5: reference to non-existent subpattern
  7925. /(?(+10))/
  7926. Failed: error 115 at offset 4: reference to non-existent subpattern
  7927. /(?(10))/
  7928. Failed: error 115 at offset 3: reference to non-existent subpattern
  7929. /(?(+2))()()/
  7930. /(?(2))()()/
  7931. /\k''/
  7932. Failed: error 162 at offset 3: subpattern name expected
  7933. /\k<>/
  7934. Failed: error 162 at offset 3: subpattern name expected
  7935. /\k{}/
  7936. Failed: error 162 at offset 3: subpattern name expected
  7937. /\k/
  7938. Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
  7939. /\kabc/
  7940. Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
  7941. /(?P=)/
  7942. Failed: error 162 at offset 4: subpattern name expected
  7943. /(?P>)/
  7944. Failed: error 162 at offset 4: subpattern name expected
  7945. /[[:foo:]]/
  7946. Failed: error 130 at offset 3: unknown POSIX class name
  7947. /[[:1234:]]/
  7948. Failed: error 130 at offset 3: unknown POSIX class name
  7949. /[[:f\oo:]]/
  7950. Failed: error 130 at offset 3: unknown POSIX class name
  7951. /[[: :]]/
  7952. Failed: error 130 at offset 3: unknown POSIX class name
  7953. /[[:...:]]/
  7954. Failed: error 130 at offset 3: unknown POSIX class name
  7955. /[[:l\ower:]]/
  7956. Failed: error 130 at offset 3: unknown POSIX class name
  7957. /[[:abc\:]]/
  7958. Failed: error 130 at offset 3: unknown POSIX class name
  7959. /[abc[:x\]pqr:]]/
  7960. Failed: error 130 at offset 6: unknown POSIX class name
  7961. /[[:a\dz:]]/
  7962. Failed: error 130 at offset 3: unknown POSIX class name
  7963. /(^(a|b\g<-1'c))/
  7964. Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7965. /^(?+1)(?<a>x|y){0}z/
  7966. xzxx
  7967. 0: xz
  7968. yzyy
  7969. 0: yz
  7970. \= Expect no match
  7971. xxz
  7972. No match
  7973. /(\3)(\1)(a)/
  7974. \= Expect no match
  7975. cat
  7976. No match
  7977. /(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
  7978. cat
  7979. 0: a
  7980. 1:
  7981. 2:
  7982. 3: a
  7983. /TA]/
  7984. The ACTA] comes
  7985. 0: TA]
  7986. /TA]/allow_empty_class,match_unset_backref,dupnames
  7987. The ACTA] comes
  7988. 0: TA]
  7989. /(?2)[]a()b](abc)/
  7990. Failed: error 115 at offset 3: reference to non-existent subpattern
  7991. abcbabc
  7992. /(?2)[^]a()b](abc)/
  7993. Failed: error 115 at offset 3: reference to non-existent subpattern
  7994. abcbabc
  7995. /(?1)[]a()b](abc)/
  7996. abcbabc
  7997. 0: abcbabc
  7998. 1: abc
  7999. \= Expect no match
  8000. abcXabc
  8001. No match
  8002. /(?1)[^]a()b](abc)/
  8003. abcXabc
  8004. 0: abcXabc
  8005. 1: abc
  8006. \= Expect no match
  8007. abcbabc
  8008. No match
  8009. /(?2)[]a()b](abc)(xyz)/
  8010. xyzbabcxyz
  8011. 0: xyzbabcxyz
  8012. 1: abc
  8013. 2: xyz
  8014. /(?&N)[]a(?<N>)](?<M>abc)/
  8015. Failed: error 115 at offset 3: reference to non-existent subpattern
  8016. abc<abc
  8017. /(?&N)[]a(?<N>)](abc)/
  8018. Failed: error 115 at offset 3: reference to non-existent subpattern
  8019. abc<abc
  8020. /a[]b/
  8021. Failed: error 106 at offset 4: missing terminating ] for character class
  8022. /a[^]b/
  8023. Failed: error 106 at offset 5: missing terminating ] for character class
  8024. /a[]b/allow_empty_class,match_unset_backref,dupnames
  8025. \= Expect no match
  8026. ab
  8027. No match
  8028. /a[]+b/allow_empty_class,match_unset_backref,dupnames
  8029. \= Expect no match
  8030. ab
  8031. No match
  8032. /a[]*+b/allow_empty_class,match_unset_backref,dupnames
  8033. \= Expect no match
  8034. ab
  8035. No match
  8036. /a[^]b/allow_empty_class,match_unset_backref,dupnames
  8037. aXb
  8038. 0: aXb
  8039. a\nb
  8040. 0: a\x0ab
  8041. \= Expect no match
  8042. ab
  8043. No match
  8044. /a[^]+b/allow_empty_class,match_unset_backref,dupnames
  8045. aXb
  8046. 0: aXb
  8047. a\nX\nXb
  8048. 0: a\x0aX\x0aXb
  8049. \= Expect no match
  8050. ab
  8051. No match
  8052. /a(?!)b/B
  8053. ------------------------------------------------------------------
  8054. Bra
  8055. a
  8056. *FAIL
  8057. b
  8058. Ket
  8059. End
  8060. ------------------------------------------------------------------
  8061. /(?!)?a/B
  8062. ------------------------------------------------------------------
  8063. Bra
  8064. Brazero
  8065. Assert not
  8066. Ket
  8067. a
  8068. Ket
  8069. End
  8070. ------------------------------------------------------------------
  8071. ab
  8072. 0: a
  8073. /a(*FAIL)+b/
  8074. Failed: error 109 at offset 8: quantifier does not follow a repeatable item
  8075. /(abc|pqr|123){0}[xyz]/I
  8076. Capture group count = 1
  8077. Starting code units: x y z
  8078. Subject length lower bound = 1
  8079. /(?(?=.*b)b|^)/I,auto_callout
  8080. Capture group count = 0
  8081. May match empty string
  8082. Options: auto_callout
  8083. Subject length lower bound = 0
  8084. adc
  8085. --->adc
  8086. +0 ^ (?
  8087. +2 ^ (?=
  8088. +5 ^ .*
  8089. +7 ^ ^ b
  8090. +7 ^ ^ b
  8091. +7 ^^ b
  8092. +7 ^ b
  8093. +11 ^ ^
  8094. +12 ^ )
  8095. +13 ^ End of pattern
  8096. 0:
  8097. abc
  8098. --->abc
  8099. +0 ^ (?
  8100. +2 ^ (?=
  8101. +5 ^ .*
  8102. +7 ^ ^ b
  8103. +7 ^ ^ b
  8104. +7 ^^ b
  8105. +8 ^ ^ )
  8106. +9 ^ b
  8107. +0 ^ (?
  8108. +2 ^ (?=
  8109. +5 ^ .*
  8110. +7 ^ ^ b
  8111. +7 ^^ b
  8112. +7 ^ b
  8113. +8 ^^ )
  8114. +9 ^ b
  8115. +10 ^^ |
  8116. +13 ^^ End of pattern
  8117. 0: b
  8118. /(?(?=b).*b|^d)/I
  8119. Capture group count = 0
  8120. Subject length lower bound = 1
  8121. /(?(?=.*b).*b|^d)/I
  8122. Capture group count = 0
  8123. Subject length lower bound = 1
  8124. /xyz/auto_callout
  8125. xyz
  8126. --->xyz
  8127. +0 ^ x
  8128. +1 ^^ y
  8129. +2 ^ ^ z
  8130. +3 ^ ^ End of pattern
  8131. 0: xyz
  8132. abcxyz
  8133. --->abcxyz
  8134. +0 ^ x
  8135. +1 ^^ y
  8136. +2 ^ ^ z
  8137. +3 ^ ^ End of pattern
  8138. 0: xyz
  8139. \= Expect no match
  8140. abc
  8141. No match
  8142. abcxypqr
  8143. No match
  8144. /xyz/auto_callout,no_start_optimize
  8145. abcxyz
  8146. --->abcxyz
  8147. +0 ^ x
  8148. +0 ^ x
  8149. +0 ^ x
  8150. +0 ^ x
  8151. +1 ^^ y
  8152. +2 ^ ^ z
  8153. +3 ^ ^ End of pattern
  8154. 0: xyz
  8155. \= Expect no match
  8156. abc
  8157. --->abc
  8158. +0 ^ x
  8159. +0 ^ x
  8160. +0 ^ x
  8161. +0 ^ x
  8162. No match
  8163. abcxypqr
  8164. --->abcxypqr
  8165. +0 ^ x
  8166. +0 ^ x
  8167. +0 ^ x
  8168. +0 ^ x
  8169. +1 ^^ y
  8170. +2 ^ ^ z
  8171. +0 ^ x
  8172. +0 ^ x
  8173. +0 ^ x
  8174. +0 ^ x
  8175. +0 ^ x
  8176. No match
  8177. /(*NO_START_OPT)xyz/auto_callout
  8178. abcxyz
  8179. --->abcxyz
  8180. +15 ^ x
  8181. +15 ^ x
  8182. +15 ^ x
  8183. +15 ^ x
  8184. +16 ^^ y
  8185. +17 ^ ^ z
  8186. +18 ^ ^ End of pattern
  8187. 0: xyz
  8188. /(*NO_AUTO_POSSESS)a+b/B
  8189. ------------------------------------------------------------------
  8190. Bra
  8191. a+
  8192. b
  8193. Ket
  8194. End
  8195. ------------------------------------------------------------------
  8196. /xyz/auto_callout,no_start_optimize
  8197. abcxyz
  8198. --->abcxyz
  8199. +0 ^ x
  8200. +0 ^ x
  8201. +0 ^ x
  8202. +0 ^ x
  8203. +1 ^^ y
  8204. +2 ^ ^ z
  8205. +3 ^ ^ End of pattern
  8206. 0: xyz
  8207. /^"((?(?=[a])[^"])|b)*"$/auto_callout
  8208. "ab"
  8209. --->"ab"
  8210. +0 ^ ^
  8211. +1 ^ "
  8212. +2 ^^ (
  8213. +3 ^^ (?
  8214. +5 ^^ (?=
  8215. +8 ^^ [a]
  8216. +11 ^ ^ )
  8217. +12 ^^ [^"]
  8218. +16 ^ ^ )
  8219. +17 ^ ^ |
  8220. +3 ^ ^ (?
  8221. +5 ^ ^ (?=
  8222. +8 ^ ^ [a]
  8223. +17 ^ ^ |
  8224. +21 ^ ^ "
  8225. +18 ^ ^ b
  8226. +19 ^ ^ )*
  8227. +3 ^ ^ (?
  8228. +5 ^ ^ (?=
  8229. +8 ^ ^ [a]
  8230. +17 ^ ^ |
  8231. +21 ^ ^ "
  8232. +22 ^ ^ $
  8233. +23 ^ ^ End of pattern
  8234. 0: "ab"
  8235. 1:
  8236. /^"((?(?=[a])[^"])|b)*"$/
  8237. "ab"
  8238. 0: "ab"
  8239. 1:
  8240. /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
  8241. Failed: error 115 at offset 5: reference to non-existent subpattern
  8242. XYabcdY
  8243. /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
  8244. XYabcdY
  8245. 0: XYabcdY
  8246. 1: a
  8247. 2: b
  8248. 3: c
  8249. 4: d
  8250. 5: Y
  8251. /Xa{2,4}b/
  8252. X\=ps
  8253. Partial match: X
  8254. Xa\=ps
  8255. Partial match: Xa
  8256. Xaa\=ps
  8257. Partial match: Xaa
  8258. Xaaa\=ps
  8259. Partial match: Xaaa
  8260. Xaaaa\=ps
  8261. Partial match: Xaaaa
  8262. /Xa{2,4}?b/
  8263. X\=ps
  8264. Partial match: X
  8265. Xa\=ps
  8266. Partial match: Xa
  8267. Xaa\=ps
  8268. Partial match: Xaa
  8269. Xaaa\=ps
  8270. Partial match: Xaaa
  8271. Xaaaa\=ps
  8272. Partial match: Xaaaa
  8273. /Xa{2,4}+b/
  8274. X\=ps
  8275. Partial match: X
  8276. Xa\=ps
  8277. Partial match: Xa
  8278. Xaa\=ps
  8279. Partial match: Xaa
  8280. Xaaa\=ps
  8281. Partial match: Xaaa
  8282. Xaaaa\=ps
  8283. Partial match: Xaaaa
  8284. /X\d{2,4}b/
  8285. X\=ps
  8286. Partial match: X
  8287. X3\=ps
  8288. Partial match: X3
  8289. X33\=ps
  8290. Partial match: X33
  8291. X333\=ps
  8292. Partial match: X333
  8293. X3333\=ps
  8294. Partial match: X3333
  8295. /X\d{2,4}?b/
  8296. X\=ps
  8297. Partial match: X
  8298. X3\=ps
  8299. Partial match: X3
  8300. X33\=ps
  8301. Partial match: X33
  8302. X333\=ps
  8303. Partial match: X333
  8304. X3333\=ps
  8305. Partial match: X3333
  8306. /X\d{2,4}+b/
  8307. X\=ps
  8308. Partial match: X
  8309. X3\=ps
  8310. Partial match: X3
  8311. X33\=ps
  8312. Partial match: X33
  8313. X333\=ps
  8314. Partial match: X333
  8315. X3333\=ps
  8316. Partial match: X3333
  8317. /X\D{2,4}b/
  8318. X\=ps
  8319. Partial match: X
  8320. Xa\=ps
  8321. Partial match: Xa
  8322. Xaa\=ps
  8323. Partial match: Xaa
  8324. Xaaa\=ps
  8325. Partial match: Xaaa
  8326. Xaaaa\=ps
  8327. Partial match: Xaaaa
  8328. /X\D{2,4}?b/
  8329. X\=ps
  8330. Partial match: X
  8331. Xa\=ps
  8332. Partial match: Xa
  8333. Xaa\=ps
  8334. Partial match: Xaa
  8335. Xaaa\=ps
  8336. Partial match: Xaaa
  8337. Xaaaa\=ps
  8338. Partial match: Xaaaa
  8339. /X\D{2,4}+b/
  8340. X\=ps
  8341. Partial match: X
  8342. Xa\=ps
  8343. Partial match: Xa
  8344. Xaa\=ps
  8345. Partial match: Xaa
  8346. Xaaa\=ps
  8347. Partial match: Xaaa
  8348. Xaaaa\=ps
  8349. Partial match: Xaaaa
  8350. /X[abc]{2,4}b/
  8351. X\=ps
  8352. Partial match: X
  8353. Xa\=ps
  8354. Partial match: Xa
  8355. Xaa\=ps
  8356. Partial match: Xaa
  8357. Xaaa\=ps
  8358. Partial match: Xaaa
  8359. Xaaaa\=ps
  8360. Partial match: Xaaaa
  8361. /X[abc]{2,4}?b/
  8362. X\=ps
  8363. Partial match: X
  8364. Xa\=ps
  8365. Partial match: Xa
  8366. Xaa\=ps
  8367. Partial match: Xaa
  8368. Xaaa\=ps
  8369. Partial match: Xaaa
  8370. Xaaaa\=ps
  8371. Partial match: Xaaaa
  8372. /X[abc]{2,4}+b/
  8373. X\=ps
  8374. Partial match: X
  8375. Xa\=ps
  8376. Partial match: Xa
  8377. Xaa\=ps
  8378. Partial match: Xaa
  8379. Xaaa\=ps
  8380. Partial match: Xaaa
  8381. Xaaaa\=ps
  8382. Partial match: Xaaaa
  8383. /X[^a]{2,4}b/
  8384. X\=ps
  8385. Partial match: X
  8386. Xz\=ps
  8387. Partial match: Xz
  8388. Xzz\=ps
  8389. Partial match: Xzz
  8390. Xzzz\=ps
  8391. Partial match: Xzzz
  8392. Xzzzz\=ps
  8393. Partial match: Xzzzz
  8394. /X[^a]{2,4}?b/
  8395. X\=ps
  8396. Partial match: X
  8397. Xz\=ps
  8398. Partial match: Xz
  8399. Xzz\=ps
  8400. Partial match: Xzz
  8401. Xzzz\=ps
  8402. Partial match: Xzzz
  8403. Xzzzz\=ps
  8404. Partial match: Xzzzz
  8405. /X[^a]{2,4}+b/
  8406. X\=ps
  8407. Partial match: X
  8408. Xz\=ps
  8409. Partial match: Xz
  8410. Xzz\=ps
  8411. Partial match: Xzz
  8412. Xzzz\=ps
  8413. Partial match: Xzzz
  8414. Xzzzz\=ps
  8415. Partial match: Xzzzz
  8416. /(Y)X\1{2,4}b/
  8417. YX\=ps
  8418. Partial match: YX
  8419. YXY\=ps
  8420. Partial match: YXY
  8421. YXYY\=ps
  8422. Partial match: YXYY
  8423. YXYYY\=ps
  8424. Partial match: YXYYY
  8425. YXYYYY\=ps
  8426. Partial match: YXYYYY
  8427. /(Y)X\1{2,4}?b/
  8428. YX\=ps
  8429. Partial match: YX
  8430. YXY\=ps
  8431. Partial match: YXY
  8432. YXYY\=ps
  8433. Partial match: YXYY
  8434. YXYYY\=ps
  8435. Partial match: YXYYY
  8436. YXYYYY\=ps
  8437. Partial match: YXYYYY
  8438. /(Y)X\1{2,4}+b/
  8439. YX\=ps
  8440. Partial match: YX
  8441. YXY\=ps
  8442. Partial match: YXY
  8443. YXYY\=ps
  8444. Partial match: YXYY
  8445. YXYYY\=ps
  8446. Partial match: YXYYY
  8447. YXYYYY\=ps
  8448. Partial match: YXYYYY
  8449. /\++\KZ|\d+X|9+Y/startchar
  8450. ++++123999\=ps
  8451. Partial match: 123999
  8452. ++++123999Y\=ps
  8453. 0: 999Y
  8454. ++++Z1234\=ps
  8455. 0: ++++Z
  8456. ^^^^
  8457. /Z(*F)/
  8458. \= Expect no match
  8459. Z\=ps
  8460. No match
  8461. ZA\=ps
  8462. No match
  8463. /Z(?!)/
  8464. \= Expect no match
  8465. Z\=ps
  8466. No match
  8467. ZA\=ps
  8468. No match
  8469. /dog(sbody)?/
  8470. dogs\=ps
  8471. 0: dog
  8472. dogs\=ph
  8473. Partial match: dogs
  8474. /dog(sbody)??/
  8475. dogs\=ps
  8476. 0: dog
  8477. dogs\=ph
  8478. 0: dog
  8479. /dog|dogsbody/
  8480. dogs\=ps
  8481. 0: dog
  8482. dogs\=ph
  8483. 0: dog
  8484. /dogsbody|dog/
  8485. dogs\=ps
  8486. 0: dog
  8487. dogs\=ph
  8488. Partial match: dogs
  8489. /\bthe cat\b/
  8490. the cat\=ps
  8491. 0: the cat
  8492. the cat\=ph
  8493. Partial match: the cat
  8494. /abc/
  8495. abc\=ps
  8496. 0: abc
  8497. abc\=ph
  8498. 0: abc
  8499. /abc\K123/startchar
  8500. xyzabc123pqr
  8501. 0: abc123
  8502. ^^^
  8503. xyzabc12\=ps
  8504. Partial match: abc12
  8505. xyzabc12\=ph
  8506. Partial match: abc12
  8507. /(?<=abc)123/
  8508. xyzabc123pqr
  8509. 0: 123
  8510. xyzabc12\=ps
  8511. Partial match: 12
  8512. xyzabc12\=ph
  8513. Partial match: 12
  8514. /\babc\b/
  8515. +++abc+++
  8516. 0: abc
  8517. +++ab\=ps
  8518. Partial match: ab
  8519. +++ab\=ph
  8520. Partial match: ab
  8521. /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/B
  8522. ------------------------------------------------------------------
  8523. Bra
  8524. Recurse
  8525. Recurse
  8526. Cond
  8527. Cond false
  8528. CBra 1
  8529. <
  8530. [^m]
  8531. [^>]
  8532. >
  8533. [^<]
  8534. Ket
  8535. CBra 2
  8536. \w*+
  8537. Ket
  8538. Ket
  8539. Ket
  8540. End
  8541. ------------------------------------------------------------------
  8542. /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/B
  8543. ------------------------------------------------------------------
  8544. Bra
  8545. Recurse
  8546. Recurse
  8547. Cond
  8548. Cond false
  8549. CBra 1
  8550. <
  8551. [\x00-/:-\xff] (neg)
  8552. [^>]
  8553. >
  8554. [^<]
  8555. Ket
  8556. CBra 2
  8557. \w*+
  8558. Ket
  8559. Ket
  8560. Ket
  8561. End
  8562. ------------------------------------------------------------------
  8563. /(ab)(x(y)z(cd(*ACCEPT)))pq/B
  8564. ------------------------------------------------------------------
  8565. Bra
  8566. CBra 1
  8567. ab
  8568. Ket
  8569. CBra 2
  8570. x
  8571. CBra 3
  8572. y
  8573. Ket
  8574. z
  8575. CBra 4
  8576. cd
  8577. Close 4
  8578. Close 2
  8579. *ACCEPT
  8580. Ket
  8581. Ket
  8582. pq
  8583. Ket
  8584. End
  8585. ------------------------------------------------------------------
  8586. /abc\K/aftertext,startchar
  8587. abcdef
  8588. 0: abc
  8589. ^^^
  8590. 0+ def
  8591. abcdef\=notempty_atstart
  8592. 0: abc
  8593. ^^^
  8594. 0+ def
  8595. xyzabcdef\=notempty_atstart
  8596. 0: abc
  8597. ^^^
  8598. 0+ def
  8599. \= Expect no match
  8600. abcdef\=notempty
  8601. No match
  8602. xyzabcdef\=notempty
  8603. No match
  8604. /^(?:(?=abc)|abc\K)/aftertext,startchar
  8605. abcdef
  8606. 0:
  8607. 0+ abcdef
  8608. abcdef\=notempty_atstart
  8609. 0: abc
  8610. ^^^
  8611. 0+ def
  8612. \= Expect no match
  8613. abcdef\=notempty
  8614. No match
  8615. /a?b?/aftertext
  8616. xyz
  8617. 0:
  8618. 0+ xyz
  8619. xyzabc
  8620. 0:
  8621. 0+ xyzabc
  8622. xyzabc\=notempty
  8623. 0: ab
  8624. 0+ c
  8625. xyzabc\=notempty_atstart
  8626. 0:
  8627. 0+ yzabc
  8628. xyz\=notempty_atstart
  8629. 0:
  8630. 0+ yz
  8631. \= Expect no match
  8632. xyz\=notempty
  8633. No match
  8634. /^a?b?/aftertext
  8635. xyz
  8636. 0:
  8637. 0+ xyz
  8638. xyzabc
  8639. 0:
  8640. 0+ xyzabc
  8641. \= Expect no match
  8642. xyzabc\=notempty
  8643. No match
  8644. xyzabc\=notempty_atstart
  8645. No match
  8646. xyz\=notempty_atstart
  8647. No match
  8648. xyz\=notempty
  8649. No match
  8650. /^(?<name>a|b\g<name>c)/
  8651. aaaa
  8652. 0: a
  8653. 1: a
  8654. bacxxx
  8655. 0: bac
  8656. 1: bac
  8657. bbaccxxx
  8658. 0: bbacc
  8659. 1: bbacc
  8660. bbbacccxx
  8661. 0: bbbaccc
  8662. 1: bbbaccc
  8663. /^(?<name>a|b\g'name'c)/
  8664. aaaa
  8665. 0: a
  8666. 1: a
  8667. bacxxx
  8668. 0: bac
  8669. 1: bac
  8670. bbaccxxx
  8671. 0: bbacc
  8672. 1: bbacc
  8673. bbbacccxx
  8674. 0: bbbaccc
  8675. 1: bbbaccc
  8676. /^(a|b\g<1>c)/
  8677. aaaa
  8678. 0: a
  8679. 1: a
  8680. bacxxx
  8681. 0: bac
  8682. 1: bac
  8683. bbaccxxx
  8684. 0: bbacc
  8685. 1: bbacc
  8686. bbbacccxx
  8687. 0: bbbaccc
  8688. 1: bbbaccc
  8689. /^(a|b\g'1'c)/
  8690. aaaa
  8691. 0: a
  8692. 1: a
  8693. bacxxx
  8694. 0: bac
  8695. 1: bac
  8696. bbaccxxx
  8697. 0: bbacc
  8698. 1: bbacc
  8699. bbbacccxx
  8700. 0: bbbaccc
  8701. 1: bbbaccc
  8702. /^(a|b\g'-1'c)/
  8703. aaaa
  8704. 0: a
  8705. 1: a
  8706. bacxxx
  8707. 0: bac
  8708. 1: bac
  8709. bbaccxxx
  8710. 0: bbacc
  8711. 1: bbacc
  8712. bbbacccxx
  8713. 0: bbbaccc
  8714. 1: bbbaccc
  8715. /(^(a|b\g<-1>c))/
  8716. aaaa
  8717. 0: a
  8718. 1: a
  8719. 2: a
  8720. bacxxx
  8721. 0: bac
  8722. 1: bac
  8723. 2: bac
  8724. bbaccxxx
  8725. 0: bbacc
  8726. 1: bbacc
  8727. 2: bbacc
  8728. bbbacccxx
  8729. 0: bbbaccc
  8730. 1: bbbaccc
  8731. 2: bbbaccc
  8732. /(?-i:\g<name>)(?i:(?<name>a))/
  8733. XaaX
  8734. 0: aa
  8735. 1: a
  8736. XAAX
  8737. 0: AA
  8738. 1: A
  8739. /(?i:\g<name>)(?-i:(?<name>a))/
  8740. XaaX
  8741. 0: aa
  8742. 1: a
  8743. \= Expect no match
  8744. XAAX
  8745. No match
  8746. /(?-i:\g<+1>)(?i:(a))/
  8747. XaaX
  8748. 0: aa
  8749. 1: a
  8750. XAAX
  8751. 0: AA
  8752. 1: A
  8753. /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
  8754. /(?<n>a|b|c)\g<n>*/
  8755. abc
  8756. 0: abc
  8757. 1: a
  8758. accccbbb
  8759. 0: accccbbb
  8760. 1: a
  8761. /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
  8762. XYabcdY
  8763. 0: XYabcdY
  8764. 1: a
  8765. 2: b
  8766. 3: <unset>
  8767. 4: <unset>
  8768. 5: c
  8769. 6: d
  8770. 7: Y
  8771. /(?<=b(?1)|zzz)(a)/
  8772. xbaax
  8773. 0: a
  8774. 1: a
  8775. xzzzax
  8776. 0: a
  8777. 1: a
  8778. /(a)(?<=b\1)/
  8779. /(a)(?<=b+(?1))/
  8780. Failed: error 125 at offset 3: length of lookbehind assertion is not limited
  8781. /(a+)(?<=b(?1))/
  8782. Failed: error 125 at offset 4: length of lookbehind assertion is not limited
  8783. /(a(?<=b(?1)))/
  8784. Failed: error 125 at offset 2: length of lookbehind assertion is not limited
  8785. /(?<=b(?1))xyz/
  8786. Failed: error 115 at offset 8: reference to non-existent subpattern
  8787. /(?<=b(?1))xyz(b+)pqrstuvew/
  8788. Failed: error 125 at offset 0: length of lookbehind assertion is not limited
  8789. /(a|bc)\1/I
  8790. Capture group count = 1
  8791. Max back reference = 1
  8792. Starting code units: a b
  8793. Subject length lower bound = 2
  8794. /(a|bc)\1{2,3}/I
  8795. Capture group count = 1
  8796. Max back reference = 1
  8797. Starting code units: a b
  8798. Subject length lower bound = 3
  8799. /(a|bc)(?1)/I
  8800. Capture group count = 1
  8801. Starting code units: a b
  8802. Subject length lower bound = 2
  8803. /(a|b\1)(a|b\1)/I
  8804. Capture group count = 2
  8805. Max back reference = 1
  8806. Starting code units: a b
  8807. Subject length lower bound = 2
  8808. /(a|b\1){2}/I
  8809. Capture group count = 1
  8810. Max back reference = 1
  8811. Starting code units: a b
  8812. Subject length lower bound = 2
  8813. /(a|bbbb\1)(a|bbbb\1)/I
  8814. Capture group count = 2
  8815. Max back reference = 1
  8816. Starting code units: a b
  8817. Subject length lower bound = 2
  8818. /(a|bbbb\1){2}/I
  8819. Capture group count = 1
  8820. Max back reference = 1
  8821. Starting code units: a b
  8822. Subject length lower bound = 2
  8823. /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/I
  8824. Capture group count = 1
  8825. Compile options: <none>
  8826. Overall options: anchored
  8827. First code unit = 'F'
  8828. Last code unit = ':'
  8829. Subject length lower bound = 22
  8830. /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/Iis
  8831. Capture group count = 11
  8832. Options: caseless dotall
  8833. First code unit = '<'
  8834. Last code unit = '>'
  8835. Subject length lower bound = 47
  8836. "(?>.*/)foo"I
  8837. Capture group count = 0
  8838. Last code unit = 'o'
  8839. Subject length lower bound = 4
  8840. /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /Ix
  8841. Capture group count = 0
  8842. Options: extended
  8843. Last code unit = '-'
  8844. Subject length lower bound = 8
  8845. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/Ii
  8846. Capture group count = 1
  8847. Options: caseless
  8848. Starting code units: A B C a b c
  8849. Subject length lower bound = 1
  8850. /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/I
  8851. Capture group count = 0
  8852. Starting code units: c d
  8853. Last code unit = 'b'
  8854. Subject length lower bound = 41
  8855. /<a[\s]+href[\s]*=[\s]* # find <a href=
  8856. ([\"\'])? # find single or double quote
  8857. (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
  8858. # quote, otherwise match up to next space
  8859. /Iisx
  8860. Capture group count = 3
  8861. Max back reference = 1
  8862. Options: caseless dotall extended
  8863. First code unit = '<'
  8864. Last code unit = '='
  8865. Subject length lower bound = 9
  8866. /^(?!:) # colon disallowed at start
  8867. (?: # start of item
  8868. (?: [0-9a-f]{1,4} | # 1-4 hex digits or
  8869. (?(1)0 | () ) ) # if null previously matched, fail; else null
  8870. : # followed by colon
  8871. ){1,7} # end item; 1-7 of them required
  8872. [0-9a-f]{1,4} $ # final hex number at end of string
  8873. (?(1)|.) # check that there was an empty component
  8874. /Iix
  8875. Capture group count = 1
  8876. Max back reference = 1
  8877. Compile options: caseless extended
  8878. Overall options: anchored caseless extended
  8879. Last code unit = ':'
  8880. Subject length lower bound = 2
  8881. /(?|(?<a>A)|(?<a>B))/I
  8882. Capture group count = 1
  8883. Named capture groups:
  8884. a 1
  8885. Starting code units: A B
  8886. Subject length lower bound = 1
  8887. AB\=copy=a
  8888. 0: A
  8889. 1: A
  8890. C A (1) a (group 1)
  8891. BA\=copy=a
  8892. 0: B
  8893. 1: B
  8894. C B (1) a (group 1)
  8895. /(?|(?<a>A)|(?<b>B))/
  8896. Failed: error 165 at offset 16: different names for subpatterns of the same number are not allowed
  8897. /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
  8898. b(?<quote> (?<apostrophe>')|(?<realquote>")) )
  8899. (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
  8900. Capture group count = 6
  8901. Max back reference = 4
  8902. Named capture groups:
  8903. apostrophe 2
  8904. apostrophe 5
  8905. quote 1
  8906. quote 4
  8907. realquote 3
  8908. realquote 6
  8909. Options: dupnames extended
  8910. Starting code units: a b
  8911. Subject length lower bound = 3
  8912. a"aaaaa
  8913. 0: a"aaaaa
  8914. 1: "
  8915. 2: <unset>
  8916. 3: "
  8917. b"aaaaa
  8918. 0: b"aaaaa
  8919. 1: <unset>
  8920. 2: <unset>
  8921. 3: <unset>
  8922. 4: "
  8923. 5: <unset>
  8924. 6: "
  8925. \= Expect no match
  8926. b"11111
  8927. No match
  8928. a"11111
  8929. No match
  8930. /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
  8931. ------------------------------------------------------------------
  8932. Bra
  8933. ^
  8934. Bra
  8935. CBra 1
  8936. a
  8937. Ket
  8938. CBra 2
  8939. b
  8940. Ket
  8941. CBra 3
  8942. c
  8943. Ket
  8944. CBra 4
  8945. d
  8946. Ket
  8947. Alt
  8948. CBra 1
  8949. e
  8950. Ket
  8951. Ket
  8952. Cond
  8953. Cond ref <D>2
  8954. X
  8955. Alt
  8956. Y
  8957. Ket
  8958. Ket
  8959. End
  8960. ------------------------------------------------------------------
  8961. Capture group count = 4
  8962. Max back reference = 4
  8963. Named capture groups:
  8964. D 4
  8965. D 1
  8966. Compile options: dupnames extended
  8967. Overall options: anchored dupnames extended
  8968. Starting code units: a e
  8969. Subject length lower bound = 2
  8970. abcdX
  8971. 0: abcdX
  8972. 1: a
  8973. 2: b
  8974. 3: c
  8975. 4: d
  8976. eX
  8977. 0: eX
  8978. 1: e
  8979. \= Expect no match
  8980. abcdY
  8981. No match
  8982. ey
  8983. No match
  8984. /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/IBx,dupnames
  8985. ------------------------------------------------------------------
  8986. Bra
  8987. CBra 1
  8988. a
  8989. Ket
  8990. CBra 2
  8991. b
  8992. Ket
  8993. CBra 3
  8994. c
  8995. Ket
  8996. CBra 4
  8997. d
  8998. Cond
  8999. Cond recurse <A>2
  9000. $
  9001. Alt
  9002. Recurse
  9003. Ket
  9004. Ket
  9005. Ket
  9006. End
  9007. ------------------------------------------------------------------
  9008. Capture group count = 4
  9009. Max back reference = 4
  9010. Named capture groups:
  9011. A 1
  9012. A 4
  9013. Options: dupnames extended
  9014. First code unit = 'a'
  9015. Last code unit = 'd'
  9016. Subject length lower bound = 4
  9017. abcdd
  9018. 0: abcdd
  9019. 1: a
  9020. 2: b
  9021. 3: c
  9022. 4: dd
  9023. \= Expect no match
  9024. abcdde
  9025. No match
  9026. /abcd*/
  9027. xxxxabcd\=ps
  9028. 0: abcd
  9029. xxxxabcd\=ph
  9030. Partial match: abcd
  9031. /abcd*/i
  9032. xxxxabcd\=ps
  9033. 0: abcd
  9034. xxxxabcd\=ph
  9035. Partial match: abcd
  9036. XXXXABCD\=ps
  9037. 0: ABCD
  9038. XXXXABCD\=ph
  9039. Partial match: ABCD
  9040. /abc\d*/
  9041. xxxxabc1\=ps
  9042. 0: abc1
  9043. xxxxabc1\=ph
  9044. Partial match: abc1
  9045. /(a)bc\1*/
  9046. xxxxabca\=ps
  9047. 0: abca
  9048. 1: a
  9049. xxxxabca\=ph
  9050. Partial match: abca
  9051. /abc[de]*/
  9052. xxxxabcde\=ps
  9053. 0: abcde
  9054. xxxxabcde\=ph
  9055. Partial match: abcde
  9056. /(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
  9057. cat
  9058. 0: a
  9059. 1:
  9060. 2:
  9061. 3: a
  9062. /(\3)(\1)(a)/I,allow_empty_class,match_unset_backref,dupnames
  9063. Capture group count = 3
  9064. Max back reference = 3
  9065. Options: allow_empty_class dupnames match_unset_backref
  9066. Last code unit = 'a'
  9067. Subject length lower bound = 1
  9068. cat
  9069. 0: a
  9070. 1:
  9071. 2:
  9072. 3: a
  9073. /(\3)(\1)(a)/I
  9074. Capture group count = 3
  9075. Max back reference = 3
  9076. Last code unit = 'a'
  9077. Subject length lower bound = 3
  9078. \= Expect no match
  9079. cat
  9080. No match
  9081. /i(?(DEFINE)(?<s>a))/I
  9082. Capture group count = 1
  9083. Named capture groups:
  9084. s 1
  9085. First code unit = 'i'
  9086. Subject length lower bound = 1
  9087. i
  9088. 0: i
  9089. /()i(?(1)a)/I
  9090. Capture group count = 1
  9091. Max back reference = 1
  9092. First code unit = 'i'
  9093. Subject length lower bound = 1
  9094. ia
  9095. 0: ia
  9096. 1:
  9097. /(?i)a(?-i)b|c/B
  9098. ------------------------------------------------------------------
  9099. Bra
  9100. /i a
  9101. b
  9102. Alt
  9103. c
  9104. Ket
  9105. End
  9106. ------------------------------------------------------------------
  9107. XabX
  9108. 0: ab
  9109. XAbX
  9110. 0: Ab
  9111. CcC
  9112. 0: c
  9113. \= Expect no match
  9114. XABX
  9115. No match
  9116. /(?i)a(?s)b|c/B
  9117. ------------------------------------------------------------------
  9118. Bra
  9119. /i ab
  9120. Alt
  9121. /i c
  9122. Ket
  9123. End
  9124. ------------------------------------------------------------------
  9125. /(?i)a(?s-i)b|c/B
  9126. ------------------------------------------------------------------
  9127. Bra
  9128. /i a
  9129. b
  9130. Alt
  9131. c
  9132. Ket
  9133. End
  9134. ------------------------------------------------------------------
  9135. /^(ab(c\1)d|x){2}$/B
  9136. ------------------------------------------------------------------
  9137. Bra
  9138. ^
  9139. CBra 1
  9140. ab
  9141. CBra 2
  9142. c
  9143. \1
  9144. Ket
  9145. d
  9146. Alt
  9147. x
  9148. Ket
  9149. CBra 1
  9150. ab
  9151. CBra 2
  9152. c
  9153. \1
  9154. Ket
  9155. d
  9156. Alt
  9157. x
  9158. Ket
  9159. $
  9160. Ket
  9161. End
  9162. ------------------------------------------------------------------
  9163. xabcxd
  9164. 0: xabcxd
  9165. 1: abcxd
  9166. 2: cx
  9167. /^(?&t)*+(?(DEFINE)(?<t>.))$/B
  9168. ------------------------------------------------------------------
  9169. Bra
  9170. ^
  9171. Braposzero
  9172. SBraPos
  9173. Recurse
  9174. KetRpos
  9175. Cond
  9176. Cond false
  9177. CBra 1
  9178. Any
  9179. Ket
  9180. Ket
  9181. $
  9182. Ket
  9183. End
  9184. ------------------------------------------------------------------
  9185. /^(?&t)*(?(DEFINE)(?<t>.))$/B
  9186. ------------------------------------------------------------------
  9187. Bra
  9188. ^
  9189. Brazero
  9190. SBra
  9191. Recurse
  9192. KetRmax
  9193. Cond
  9194. Cond false
  9195. CBra 1
  9196. Any
  9197. Ket
  9198. Ket
  9199. $
  9200. Ket
  9201. End
  9202. ------------------------------------------------------------------
  9203. # This one is here because Perl gives the match as "b" rather than "ab". I
  9204. # believe this to be a Perl bug.
  9205. /(?>a\Kb)z|(ab)/
  9206. ab\=startchar
  9207. 0: ab
  9208. 1: ab
  9209. /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
  9210. abcd
  9211. 0:
  9212. 1:
  9213. 2:
  9214. 0abc
  9215. 0: 0
  9216. 1: 0
  9217. 2: 0
  9218. /abc(*MARK:)pqr/
  9219. Failed: error 166 at offset 10: (*MARK) must have an argument
  9220. /abc(*:)pqr/
  9221. Failed: error 166 at offset 6: (*MARK) must have an argument
  9222. /(*COMMIT:X)/B
  9223. ------------------------------------------------------------------
  9224. Bra
  9225. *COMMIT X
  9226. Ket
  9227. End
  9228. ------------------------------------------------------------------
  9229. # This should, and does, fail. In Perl, it does not, which I think is a
  9230. # bug because replacing the B in the pattern by (B|D) does make it fail.
  9231. # Turning off Perl's optimization by inserting (??{""}) also makes it fail.
  9232. /A(*COMMIT)B/aftertext,mark
  9233. \= Expect no match
  9234. ACABX
  9235. No match
  9236. # These should be different, but in Perl they are not, which I think
  9237. # is a bug in Perl.
  9238. /A(*THEN)B|A(*THEN)C/mark
  9239. AC
  9240. 0: AC
  9241. /A(*PRUNE)B|A(*PRUNE)C/mark
  9242. \= Expect no match
  9243. AC
  9244. No match
  9245. # Mark names can be duplicated. Perl doesn't give a mark for this one,
  9246. # though PCRE2 does.
  9247. /^A(*:A)B|^X(*:A)Y/mark
  9248. \= Expect no match
  9249. XAQQ
  9250. No match, mark = A
  9251. # COMMIT at the start of a pattern should be the same as an anchor. Perl
  9252. # optimizations defeat this. So does the PCRE2 optimization unless we disable
  9253. # it.
  9254. /(*COMMIT)ABC/
  9255. ABCDEFG
  9256. 0: ABC
  9257. /(*COMMIT)ABC/no_start_optimize
  9258. \= Expect no match
  9259. DEFGABC
  9260. No match
  9261. /^(ab (c+(*THEN)cd) | xyz)/x
  9262. \= Expect no match
  9263. abcccd
  9264. No match
  9265. /^(ab (c+(*PRUNE)cd) | xyz)/x
  9266. \= Expect no match
  9267. abcccd
  9268. No match
  9269. /^(ab (c+(*FAIL)cd) | xyz)/x
  9270. \= Expect no match
  9271. abcccd
  9272. No match
  9273. # Perl gets some of these wrong
  9274. /(?>.(*ACCEPT))*?5/
  9275. abcde
  9276. 0: a
  9277. /(.(*ACCEPT))*?5/
  9278. abcde
  9279. 0: a
  9280. 1: a
  9281. /(.(*ACCEPT))5/
  9282. abcde
  9283. 0: a
  9284. 1: a
  9285. /(.(*ACCEPT))*5/
  9286. abcde
  9287. 0: a
  9288. 1: a
  9289. /A\NB./B
  9290. ------------------------------------------------------------------
  9291. Bra
  9292. A
  9293. Any
  9294. B
  9295. Any
  9296. Ket
  9297. End
  9298. ------------------------------------------------------------------
  9299. ACBD
  9300. 0: ACBD
  9301. \= Expect no match
  9302. A\nB
  9303. No match
  9304. ACB\n
  9305. No match
  9306. /A\NB./Bs
  9307. ------------------------------------------------------------------
  9308. Bra
  9309. A
  9310. Any
  9311. B
  9312. AllAny
  9313. Ket
  9314. End
  9315. ------------------------------------------------------------------
  9316. ACBD
  9317. 0: ACBD
  9318. ACB\n
  9319. 0: ACB\x0a
  9320. \= Expect no match
  9321. A\nB
  9322. No match
  9323. /A\NB/newline=crlf
  9324. A\nB
  9325. 0: A\x0aB
  9326. A\rB
  9327. 0: A\x0dB
  9328. \= Expect no match
  9329. A\r\nB
  9330. No match
  9331. /\R+b/B
  9332. ------------------------------------------------------------------
  9333. Bra
  9334. \R++
  9335. b
  9336. Ket
  9337. End
  9338. ------------------------------------------------------------------
  9339. /\R+\n/B
  9340. ------------------------------------------------------------------
  9341. Bra
  9342. \R+
  9343. \x0a
  9344. Ket
  9345. End
  9346. ------------------------------------------------------------------
  9347. /\R+\d/B
  9348. ------------------------------------------------------------------
  9349. Bra
  9350. \R++
  9351. \d
  9352. Ket
  9353. End
  9354. ------------------------------------------------------------------
  9355. /\d*\R/B
  9356. ------------------------------------------------------------------
  9357. Bra
  9358. \d*+
  9359. \R
  9360. Ket
  9361. End
  9362. ------------------------------------------------------------------
  9363. /\s*\R/B
  9364. ------------------------------------------------------------------
  9365. Bra
  9366. \s*
  9367. \R
  9368. Ket
  9369. End
  9370. ------------------------------------------------------------------
  9371. \x20\x0a
  9372. 0: \x0a
  9373. \x20\x0d
  9374. 0: \x0d
  9375. \x20\x0d\x0a
  9376. 0: \x0d\x0a
  9377. /\S*\R/B
  9378. ------------------------------------------------------------------
  9379. Bra
  9380. \S*+
  9381. \R
  9382. Ket
  9383. End
  9384. ------------------------------------------------------------------
  9385. a\x0a
  9386. 0: a\x0a
  9387. /X\h*\R/B
  9388. ------------------------------------------------------------------
  9389. Bra
  9390. X
  9391. \h*+
  9392. \R
  9393. Ket
  9394. End
  9395. ------------------------------------------------------------------
  9396. X\x20\x0a
  9397. 0: X \x0a
  9398. /X\H*\R/B
  9399. ------------------------------------------------------------------
  9400. Bra
  9401. X
  9402. \H*
  9403. \R
  9404. Ket
  9405. End
  9406. ------------------------------------------------------------------
  9407. X\x0d\x0a
  9408. 0: X\x0d\x0a
  9409. /X\H+\R/B
  9410. ------------------------------------------------------------------
  9411. Bra
  9412. X
  9413. \H+
  9414. \R
  9415. Ket
  9416. End
  9417. ------------------------------------------------------------------
  9418. X\x0d\x0a
  9419. 0: X\x0d\x0a
  9420. /X\H++\R/B
  9421. ------------------------------------------------------------------
  9422. Bra
  9423. X
  9424. \H++
  9425. \R
  9426. Ket
  9427. End
  9428. ------------------------------------------------------------------
  9429. \= Expect no match
  9430. X\x0d\x0a
  9431. No match
  9432. /(?<=abc)def/
  9433. abc\=ph
  9434. Partial match:
  9435. /abc$/
  9436. abc
  9437. 0: abc
  9438. abc\=ps
  9439. 0: abc
  9440. abc\=ph
  9441. Partial match: abc
  9442. /abc$/m
  9443. abc
  9444. 0: abc
  9445. abc\n
  9446. 0: abc
  9447. abc\=ph
  9448. Partial match: abc
  9449. abc\n\=ph
  9450. 0: abc
  9451. abc\=ps
  9452. 0: abc
  9453. abc\n\=ps
  9454. 0: abc
  9455. /abc\z/
  9456. abc
  9457. 0: abc
  9458. abc\=ps
  9459. 0: abc
  9460. abc\=ph
  9461. Partial match: abc
  9462. /abc\Z/
  9463. abc
  9464. 0: abc
  9465. abc\=ps
  9466. 0: abc
  9467. abc\=ph
  9468. Partial match: abc
  9469. /abc\b/
  9470. abc
  9471. 0: abc
  9472. abc\=ps
  9473. 0: abc
  9474. abc\=ph
  9475. Partial match: abc
  9476. /abc\B/
  9477. abc\=ps
  9478. Partial match: abc
  9479. abc\=ph
  9480. Partial match: abc
  9481. \= Expect no match
  9482. abc
  9483. No match
  9484. /.+/
  9485. \= Bad offsets
  9486. abc\=offset=4
  9487. Failed: error -33: bad offset value
  9488. abc\=offset=-4
  9489. ** Invalid value in 'offset=-4'
  9490. \= Valid data
  9491. abc\=offset=0
  9492. 0: abc
  9493. abc\=offset=1
  9494. 0: bc
  9495. abc\=offset=2
  9496. 0: c
  9497. \= Expect no match
  9498. abc\=offset=3
  9499. No match
  9500. /^\cģ/
  9501. Failed: error 168 at offset 3: \c must be followed by a printable ASCII character
  9502. /(?P<abn>(?P=abn)xxx)/B
  9503. ------------------------------------------------------------------
  9504. Bra
  9505. CBra 1
  9506. \1
  9507. xxx
  9508. Ket
  9509. Ket
  9510. End
  9511. ------------------------------------------------------------------
  9512. /(a\1z)/B
  9513. ------------------------------------------------------------------
  9514. Bra
  9515. CBra 1
  9516. a
  9517. \1
  9518. z
  9519. Ket
  9520. Ket
  9521. End
  9522. ------------------------------------------------------------------
  9523. /(?P<abn>(?P=abn)(?<badstufxxx)/B
  9524. Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator?)
  9525. /(?P<abn>(?P=axn)xxx)/B
  9526. Failed: error 115 at offset 12: reference to non-existent subpattern
  9527. /(?P<abn>(?P=axn)xxx)(?<axn>yy)/B
  9528. ------------------------------------------------------------------
  9529. Bra
  9530. CBra 1
  9531. \2
  9532. xxx
  9533. Ket
  9534. CBra 2
  9535. yy
  9536. Ket
  9537. Ket
  9538. End
  9539. ------------------------------------------------------------------
  9540. # These tests are here because Perl gets the first one wrong.
  9541. /(\R*)(.)/s
  9542. \r\n
  9543. 0: \x0d
  9544. 1:
  9545. 2: \x0d
  9546. \r\r\n\n\r
  9547. 0: \x0d\x0d\x0a\x0a\x0d
  9548. 1: \x0d\x0d\x0a\x0a
  9549. 2: \x0d
  9550. \r\r\n\n\r\n
  9551. 0: \x0d\x0d\x0a\x0a\x0d
  9552. 1: \x0d\x0d\x0a\x0a
  9553. 2: \x0d
  9554. /(\R)*(.)/s
  9555. \r\n
  9556. 0: \x0d
  9557. 1: <unset>
  9558. 2: \x0d
  9559. \r\r\n\n\r
  9560. 0: \x0d\x0d\x0a\x0a\x0d
  9561. 1: \x0a
  9562. 2: \x0d
  9563. \r\r\n\n\r\n
  9564. 0: \x0d\x0d\x0a\x0a\x0d
  9565. 1: \x0a
  9566. 2: \x0d
  9567. /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
  9568. \r\n
  9569. 0: \x0d
  9570. 1:
  9571. 2: \x0d
  9572. \r\r\n\n\r
  9573. 0: \x0d\x0d\x0a\x0a\x0d
  9574. 1: \x0d\x0d\x0a\x0a
  9575. 2: \x0d
  9576. \r\r\n\n\r\n
  9577. 0: \x0d\x0d\x0a\x0a\x0d
  9578. 1: \x0d\x0d\x0a\x0a
  9579. 2: \x0d
  9580. # -------------
  9581. /^abc$/B
  9582. ------------------------------------------------------------------
  9583. Bra
  9584. ^
  9585. abc
  9586. $
  9587. Ket
  9588. End
  9589. ------------------------------------------------------------------
  9590. /^abc$/Bm
  9591. ------------------------------------------------------------------
  9592. Bra
  9593. /m ^
  9594. abc
  9595. /m $
  9596. Ket
  9597. End
  9598. ------------------------------------------------------------------
  9599. /^(a)*+(\w)/
  9600. aaaaX
  9601. 0: aaaaX
  9602. 1: a
  9603. 2: X
  9604. \= Expect no match
  9605. aaaa
  9606. No match
  9607. /^(?:a)*+(\w)/
  9608. aaaaX
  9609. 0: aaaaX
  9610. 1: X
  9611. \= Expect no match
  9612. aaaa
  9613. No match
  9614. /(a)++1234/IB
  9615. ------------------------------------------------------------------
  9616. Bra
  9617. CBraPos 1
  9618. a
  9619. KetRpos
  9620. 1234
  9621. Ket
  9622. End
  9623. ------------------------------------------------------------------
  9624. Capture group count = 1
  9625. First code unit = 'a'
  9626. Last code unit = '4'
  9627. Subject length lower bound = 5
  9628. /([abc])++1234/I
  9629. Capture group count = 1
  9630. Starting code units: a b c
  9631. Last code unit = '4'
  9632. Subject length lower bound = 5
  9633. /(?<=(abc)+)X/
  9634. Failed: error 125 at offset 0: length of lookbehind assertion is not limited
  9635. /(^ab)/I
  9636. Capture group count = 1
  9637. Compile options: <none>
  9638. Overall options: anchored
  9639. First code unit = 'a'
  9640. Subject length lower bound = 2
  9641. /(^ab)++/I
  9642. Capture group count = 1
  9643. Compile options: <none>
  9644. Overall options: anchored
  9645. First code unit = 'a'
  9646. Subject length lower bound = 2
  9647. /(^ab|^)+/I
  9648. Capture group count = 1
  9649. May match empty string
  9650. Compile options: <none>
  9651. Overall options: anchored
  9652. Subject length lower bound = 0
  9653. /(^ab|^)++/I
  9654. Capture group count = 1
  9655. May match empty string
  9656. Compile options: <none>
  9657. Overall options: anchored
  9658. Subject length lower bound = 0
  9659. /(?:^ab)/I
  9660. Capture group count = 0
  9661. Compile options: <none>
  9662. Overall options: anchored
  9663. First code unit = 'a'
  9664. Subject length lower bound = 2
  9665. /(?:^ab)++/I
  9666. Capture group count = 0
  9667. Compile options: <none>
  9668. Overall options: anchored
  9669. First code unit = 'a'
  9670. Subject length lower bound = 2
  9671. /(?:^ab|^)+/I
  9672. Capture group count = 0
  9673. May match empty string
  9674. Compile options: <none>
  9675. Overall options: anchored
  9676. Subject length lower bound = 0
  9677. /(?:^ab|^)++/I
  9678. Capture group count = 0
  9679. May match empty string
  9680. Compile options: <none>
  9681. Overall options: anchored
  9682. Subject length lower bound = 0
  9683. /(.*ab)/I
  9684. Capture group count = 1
  9685. First code unit at start or follows newline
  9686. Last code unit = 'b'
  9687. Subject length lower bound = 2
  9688. /(.*ab)++/I
  9689. Capture group count = 1
  9690. First code unit at start or follows newline
  9691. Last code unit = 'b'
  9692. Subject length lower bound = 2
  9693. /(.*ab|.*)+/I
  9694. Capture group count = 1
  9695. May match empty string
  9696. First code unit at start or follows newline
  9697. Subject length lower bound = 0
  9698. /(.*ab|.*)++/I
  9699. Capture group count = 1
  9700. May match empty string
  9701. First code unit at start or follows newline
  9702. Subject length lower bound = 0
  9703. /(?:.*ab)/I
  9704. Capture group count = 0
  9705. First code unit at start or follows newline
  9706. Last code unit = 'b'
  9707. Subject length lower bound = 2
  9708. /(?:.*ab)++/I
  9709. Capture group count = 0
  9710. First code unit at start or follows newline
  9711. Last code unit = 'b'
  9712. Subject length lower bound = 2
  9713. /(?:.*ab|.*)+/I
  9714. Capture group count = 0
  9715. May match empty string
  9716. First code unit at start or follows newline
  9717. Subject length lower bound = 0
  9718. /(?:.*ab|.*)++/I
  9719. Capture group count = 0
  9720. May match empty string
  9721. First code unit at start or follows newline
  9722. Subject length lower bound = 0
  9723. /(?=a)[bcd]/I
  9724. Capture group count = 0
  9725. First code unit = 'a'
  9726. Subject length lower bound = 1
  9727. /((?=a))[bcd]/I
  9728. Capture group count = 1
  9729. First code unit = 'a'
  9730. Subject length lower bound = 1
  9731. /((?=a))+[bcd]/I
  9732. Capture group count = 1
  9733. First code unit = 'a'
  9734. Subject length lower bound = 1
  9735. /((?=a))++[bcd]/I
  9736. Capture group count = 1
  9737. First code unit = 'a'
  9738. Subject length lower bound = 1
  9739. /(?=a+)[bcd]/Ii
  9740. Capture group count = 0
  9741. Options: caseless
  9742. First code unit = 'a' (caseless)
  9743. Subject length lower bound = 1
  9744. /(?=a+?)[bcd]/Ii
  9745. Capture group count = 0
  9746. Options: caseless
  9747. First code unit = 'a' (caseless)
  9748. Subject length lower bound = 1
  9749. /(?=a++)[bcd]/Ii
  9750. Capture group count = 0
  9751. Options: caseless
  9752. First code unit = 'a' (caseless)
  9753. Subject length lower bound = 1
  9754. /(?=a{3})[bcd]/Ii
  9755. Capture group count = 0
  9756. Options: caseless
  9757. First code unit = 'a' (caseless)
  9758. Last code unit = 'a' (caseless)
  9759. Subject length lower bound = 2
  9760. /(abc)\1+/
  9761. # Perl doesn't get these right IMO (the 3rd is PCRE2-specific)
  9762. /(?1)(?:(b(*ACCEPT))){0}/
  9763. b
  9764. 0: b
  9765. /(?1)(?:(b(*ACCEPT))){0}c/
  9766. bc
  9767. 0: bc
  9768. \= Expect no match
  9769. b
  9770. No match
  9771. /(?1)(?:((*ACCEPT))){0}c/
  9772. c
  9773. 0: c
  9774. c\=notempty
  9775. 0: c
  9776. /^.*?(?(?=a)a|b(*THEN)c)/
  9777. \= Expect no match
  9778. ba
  9779. No match
  9780. /^.*?(?(?=a)a|bc)/
  9781. ba
  9782. 0: ba
  9783. /^.*?(?(?=a)a(*THEN)b|c)/
  9784. \= Expect no match
  9785. ac
  9786. No match
  9787. /^.*?(?(?=a)a(*THEN)b)c/
  9788. \= Expect no match
  9789. ac
  9790. No match
  9791. /^.*?(a(*THEN)b)c/
  9792. \= Expect no match
  9793. aabc
  9794. No match
  9795. /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
  9796. aabc
  9797. 0: aabc
  9798. /^.*?(a(*THEN)b|z)c/
  9799. aabc
  9800. 0: aabc
  9801. 1: ab
  9802. /^.*?(z|a(*THEN)b)c/
  9803. aabc
  9804. 0: aabc
  9805. 1: ab
  9806. # These are here because they are not Perl-compatible; the studying means the
  9807. # mark is not seen.
  9808. /(*MARK:A)(*SKIP:B)(C|X)/mark
  9809. C
  9810. 0: C
  9811. 1: C
  9812. MK: A
  9813. \= Expect no match
  9814. D
  9815. No match, mark = A
  9816. /(*:A)A+(*SKIP:A)(B|Z)/mark
  9817. \= Expect no match
  9818. AAAC
  9819. No match, mark = A
  9820. # ----------------------------
  9821. "(?=a*(*ACCEPT)b)c"
  9822. c
  9823. 0: c
  9824. c\=notempty
  9825. 0: c
  9826. /(?1)c(?(DEFINE)((*ACCEPT)b))/
  9827. c
  9828. 0: c
  9829. c\=notempty
  9830. 0: c
  9831. /(?>(*ACCEPT)b)c/
  9832. c
  9833. 0:
  9834. \= Expect no match
  9835. c\=notempty
  9836. No match
  9837. /(?:(?>(a)))+a%/allaftertext
  9838. %aa%
  9839. 0: aa%
  9840. 0+
  9841. 1: a
  9842. 1+ a%
  9843. /(a)b|ac/allaftertext
  9844. ac\=ovector=1
  9845. 0: ac
  9846. 0+
  9847. /(a)(b)x|abc/allaftertext
  9848. abc\=ovector=2
  9849. 0: abc
  9850. 0+
  9851. /(a)bc|(a)(b)\2/
  9852. abc\=ovector=1
  9853. Matched, but too many substrings
  9854. 0: abc
  9855. abc\=ovector=2
  9856. 0: abc
  9857. 1: a
  9858. aba\=ovector=1
  9859. Matched, but too many substrings
  9860. 0: aba
  9861. aba\=ovector=2
  9862. Matched, but too many substrings
  9863. 0: aba
  9864. 1: <unset>
  9865. aba\=ovector=3
  9866. Matched, but too many substrings
  9867. 0: aba
  9868. 1: <unset>
  9869. 2: a
  9870. aba\=ovector=4
  9871. 0: aba
  9872. 1: <unset>
  9873. 2: a
  9874. 3: b
  9875. /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I
  9876. Capture group count = 2
  9877. May match empty string
  9878. Subject length lower bound = 0
  9879. /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I
  9880. Capture group count = 2
  9881. Starting code units: a b
  9882. Subject length lower bound = 3
  9883. /(a(?2)|b)(b(?1)|a)(?1)(?2)/I
  9884. Capture group count = 2
  9885. Starting code units: a b
  9886. Subject length lower bound = 4
  9887. /(abc)(?1)/I
  9888. Capture group count = 1
  9889. First code unit = 'a'
  9890. Last code unit = 'c'
  9891. Subject length lower bound = 6
  9892. /(?:(foo)|(bar)|(baz))X/allcaptures
  9893. bazfooX
  9894. 0: fooX
  9895. 1: foo
  9896. 2: <unset>
  9897. 3: <unset>
  9898. foobazbarX
  9899. 0: barX
  9900. 1: <unset>
  9901. 2: bar
  9902. 3: <unset>
  9903. barfooX
  9904. 0: fooX
  9905. 1: foo
  9906. 2: <unset>
  9907. 3: <unset>
  9908. bazX
  9909. 0: bazX
  9910. 1: <unset>
  9911. 2: <unset>
  9912. 3: baz
  9913. foobarbazX
  9914. 0: bazX
  9915. 1: <unset>
  9916. 2: <unset>
  9917. 3: baz
  9918. bazfooX\=ovector=0
  9919. 0: fooX
  9920. 1: foo
  9921. 2: <unset>
  9922. 3: <unset>
  9923. bazfooX\=ovector=1
  9924. Matched, but too many substrings
  9925. 0: fooX
  9926. bazfooX\=ovector=2
  9927. 0: fooX
  9928. 1: foo
  9929. bazfooX\=ovector=3
  9930. 0: fooX
  9931. 1: foo
  9932. 2: <unset>
  9933. /(?=abc){3}abc/B
  9934. ------------------------------------------------------------------
  9935. Bra
  9936. Assert
  9937. abc
  9938. Ket
  9939. Assert
  9940. abc
  9941. Ket
  9942. Assert
  9943. abc
  9944. Ket
  9945. abc
  9946. Ket
  9947. End
  9948. ------------------------------------------------------------------
  9949. /(?=abc)+abc/B
  9950. ------------------------------------------------------------------
  9951. Bra
  9952. Assert
  9953. abc
  9954. Ket
  9955. Brazero
  9956. Assert
  9957. abc
  9958. Ket
  9959. abc
  9960. Ket
  9961. End
  9962. ------------------------------------------------------------------
  9963. /(?=abc)++abc/B
  9964. ------------------------------------------------------------------
  9965. Bra
  9966. Once
  9967. Assert
  9968. abc
  9969. Ket
  9970. Brazero
  9971. Assert
  9972. abc
  9973. Ket
  9974. Ket
  9975. abc
  9976. Ket
  9977. End
  9978. ------------------------------------------------------------------
  9979. /(?=abc){0}xyz/B
  9980. ------------------------------------------------------------------
  9981. Bra
  9982. Skip zero
  9983. Assert
  9984. abc
  9985. Ket
  9986. xyz
  9987. Ket
  9988. End
  9989. ------------------------------------------------------------------
  9990. /(?=(a))?./B
  9991. ------------------------------------------------------------------
  9992. Bra
  9993. Brazero
  9994. Assert
  9995. CBra 1
  9996. a
  9997. Ket
  9998. Ket
  9999. Any
  10000. Ket
  10001. End
  10002. ------------------------------------------------------------------
  10003. /(?=(a))??./B
  10004. ------------------------------------------------------------------
  10005. Bra
  10006. Braminzero
  10007. Assert
  10008. CBra 1
  10009. a
  10010. Ket
  10011. Ket
  10012. Any
  10013. Ket
  10014. End
  10015. ------------------------------------------------------------------
  10016. /^(?=(a)){0}b(?1)/B
  10017. ------------------------------------------------------------------
  10018. Bra
  10019. ^
  10020. Skip zero
  10021. Assert
  10022. CBra 1
  10023. a
  10024. Ket
  10025. Ket
  10026. b
  10027. Recurse
  10028. Ket
  10029. End
  10030. ------------------------------------------------------------------
  10031. /(?(DEFINE)(a))?b(?1)/B
  10032. ------------------------------------------------------------------
  10033. Bra
  10034. Cond
  10035. Cond false
  10036. CBra 1
  10037. a
  10038. Ket
  10039. Ket
  10040. b
  10041. Recurse
  10042. Ket
  10043. End
  10044. ------------------------------------------------------------------
  10045. /^(?=(?1))?[az]([abc])d/B
  10046. ------------------------------------------------------------------
  10047. Bra
  10048. ^
  10049. Brazero
  10050. Assert
  10051. Recurse
  10052. Ket
  10053. [az]
  10054. CBra 1
  10055. [a-c]
  10056. Ket
  10057. d
  10058. Ket
  10059. End
  10060. ------------------------------------------------------------------
  10061. /^(?!a){0}\w+/B
  10062. ------------------------------------------------------------------
  10063. Bra
  10064. ^
  10065. Skip zero
  10066. Assert not
  10067. a
  10068. Ket
  10069. \w++
  10070. Ket
  10071. End
  10072. ------------------------------------------------------------------
  10073. /(?<=(abc))?xyz/B
  10074. ------------------------------------------------------------------
  10075. Bra
  10076. Brazero
  10077. Assert back
  10078. Reverse
  10079. CBra 1
  10080. abc
  10081. Ket
  10082. Ket
  10083. xyz
  10084. Ket
  10085. End
  10086. ------------------------------------------------------------------
  10087. /[:a[:abc]b:]/B
  10088. ------------------------------------------------------------------
  10089. Bra
  10090. [:[a-c]
  10091. b:]
  10092. Ket
  10093. End
  10094. ------------------------------------------------------------------
  10095. /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
  10096. adz
  10097. --->adz
  10098. +0 ^ ^
  10099. +1 ^ (
  10100. +2 ^ a
  10101. +3 ^^ (*:A)
  10102. +8 ^^ (
  10103. Latest Mark: A
  10104. +9 ^^ d
  10105. +10 ^ ^ |
  10106. +18 ^ ^ z
  10107. +19 ^ ^ |
  10108. +24 ^ ^ End of pattern
  10109. 0: adz
  10110. 1: adz
  10111. 2: d
  10112. aez
  10113. --->aez
  10114. +0 ^ ^
  10115. +1 ^ (
  10116. +2 ^ a
  10117. +3 ^^ (*:A)
  10118. +8 ^^ (
  10119. Latest Mark: A
  10120. +9 ^^ d
  10121. +11 ^^ e
  10122. +12 ^ ^ (*:B)
  10123. +17 ^ ^ )
  10124. Latest Mark: B
  10125. +18 ^ ^ z
  10126. +19 ^ ^ |
  10127. +24 ^ ^ End of pattern
  10128. 0: aez
  10129. 1: aez
  10130. 2: e
  10131. aeqwerty
  10132. --->aeqwerty
  10133. +0 ^ ^
  10134. +1 ^ (
  10135. +2 ^ a
  10136. +3 ^^ (*:A)
  10137. +8 ^^ (
  10138. Latest Mark: A
  10139. +9 ^^ d
  10140. +11 ^^ e
  10141. +12 ^ ^ (*:B)
  10142. +17 ^ ^ )
  10143. Latest Mark: B
  10144. +18 ^ ^ z
  10145. +20 ^ a
  10146. +21 ^^ e
  10147. +22 ^ ^ q
  10148. +23 ^ ^ )
  10149. +24 ^ ^ End of pattern
  10150. 0: aeq
  10151. 1: aeq
  10152. /.(*F)/
  10153. \= Expect no match
  10154. abc\=ph
  10155. No match
  10156. /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
  10157. Capture group count = 0
  10158. Max lookbehind = 1
  10159. First code unit = 't'
  10160. Last code unit = 't'
  10161. Subject length lower bound = 18
  10162. /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/I
  10163. Capture group count = 0
  10164. Max lookbehind = 1
  10165. Starting code units: < o t u
  10166. Subject length lower bound = 8
  10167. /a(*SKIP)c|b(*ACCEPT)|/I,aftertext
  10168. Capture group count = 0
  10169. May match empty string
  10170. Subject length lower bound = 0
  10171. a
  10172. 0:
  10173. 0+
  10174. /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/I
  10175. Capture group count = 0
  10176. Starting code units: a b x
  10177. Subject length lower bound = 1
  10178. ax
  10179. 0: x
  10180. 'a*(*ACCEPT)b'aftertext
  10181. abc\=notempty_atstart
  10182. 0: a
  10183. 0+ bc
  10184. bbb\=notempty_atstart
  10185. 0:
  10186. 0+ bb
  10187. \= Expect no match
  10188. \=notempty_atstart
  10189. No match
  10190. /(*ACCEPT)a/I,aftertext
  10191. Capture group count = 0
  10192. May match empty string
  10193. Subject length lower bound = 0
  10194. bax
  10195. 0:
  10196. 0+ bax
  10197. /z(*ACCEPT)a/I,aftertext
  10198. Capture group count = 0
  10199. First code unit = 'z'
  10200. Subject length lower bound = 1
  10201. baxzbx
  10202. 0: z
  10203. 0+ bx
  10204. /^(?>a+)(?>(z+))\w/B
  10205. ------------------------------------------------------------------
  10206. Bra
  10207. ^
  10208. Once
  10209. a++
  10210. Ket
  10211. Once
  10212. CBra 1
  10213. z++
  10214. Ket
  10215. Ket
  10216. \w
  10217. Ket
  10218. End
  10219. ------------------------------------------------------------------
  10220. aaaazzzzb
  10221. 0: aaaazzzzb
  10222. 1: zzzz
  10223. \= Expect no match
  10224. aazz
  10225. No match
  10226. /(.)(\1|a(?2))/
  10227. bab
  10228. 0: bab
  10229. 1: b
  10230. 2: ab
  10231. /\1|(.)(?R)\1/
  10232. cbbbc
  10233. 0: cbbbc
  10234. 1: c
  10235. /(.)((?(1)c|a)|a(?2))/
  10236. \= Expect no match
  10237. baa
  10238. No match
  10239. /(?P<abn>(?P=abn)xxx)/B
  10240. ------------------------------------------------------------------
  10241. Bra
  10242. CBra 1
  10243. \1
  10244. xxx
  10245. Ket
  10246. Ket
  10247. End
  10248. ------------------------------------------------------------------
  10249. /(a\1z)/B
  10250. ------------------------------------------------------------------
  10251. Bra
  10252. CBra 1
  10253. a
  10254. \1
  10255. z
  10256. Ket
  10257. Ket
  10258. End
  10259. ------------------------------------------------------------------
  10260. /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10261. aAz
  10262. 0: aAz
  10263. \= Expect no match
  10264. ax41z
  10265. No match
  10266. /^a[m\x41]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10267. aAz
  10268. 0: aAz
  10269. /^a\x1z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10270. ax1z
  10271. 0: ax1z
  10272. /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10273. aAz
  10274. 0: aAz
  10275. \= Expect no match
  10276. au0041z
  10277. No match
  10278. /^a[m\u0041]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10279. aAz
  10280. 0: aAz
  10281. /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10282. au041z
  10283. 0: au041z
  10284. \= Expect no match
  10285. aAz
  10286. No match
  10287. /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10288. aU0041z
  10289. 0: aU0041z
  10290. \= Expect no match
  10291. aAz
  10292. No match
  10293. /^\u{7a}/alt_bsux
  10294. u{7a}
  10295. 0: u{7a}
  10296. \= Expect no match
  10297. zoo
  10298. No match
  10299. /^\u{7a}/extra_alt_bsux
  10300. zoo
  10301. 0: z
  10302. /\u{}/extra_alt_bsux
  10303. u{}
  10304. 0: u{}
  10305. /\u{Q12}/extra_alt_bsux
  10306. --u{Q12}--
  10307. 0: u{Q12}
  10308. /\u{ 12}/extra_alt_bsux
  10309. --u{ 12}--
  10310. 0: u{ 12}
  10311. /\u{{3}}/extra_alt_bsux
  10312. --u{{{}--
  10313. 0: u{{{}
  10314. /(?(?=c)c|d)++Y/B
  10315. ------------------------------------------------------------------
  10316. Bra
  10317. BraPos
  10318. Cond
  10319. Assert
  10320. c
  10321. Ket
  10322. c
  10323. Alt
  10324. d
  10325. Ket
  10326. KetRpos
  10327. Y
  10328. Ket
  10329. End
  10330. ------------------------------------------------------------------
  10331. /(?(?=c)c|d)*+Y/B
  10332. ------------------------------------------------------------------
  10333. Bra
  10334. Braposzero
  10335. BraPos
  10336. Cond
  10337. Assert
  10338. c
  10339. Ket
  10340. c
  10341. Alt
  10342. d
  10343. Ket
  10344. KetRpos
  10345. Y
  10346. Ket
  10347. End
  10348. ------------------------------------------------------------------
  10349. /a[\NB]c/
  10350. Failed: error 171 at offset 4: \N is not supported in a class
  10351. aNc
  10352. /a[B-\Nc]/
  10353. Failed: error 150 at offset 6: invalid range in character class
  10354. /a[B\Nc]/
  10355. Failed: error 171 at offset 5: \N is not supported in a class
  10356. /(a)(?2){0,1999}?(b)/
  10357. /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
  10358. # This test, with something more complicated than individual letters, causes
  10359. # different behaviour in Perl. Perhaps it disables some optimization; no tag is
  10360. # passed back for the failures, whereas in PCRE2 there is a tag.
  10361. /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark
  10362. AABC
  10363. 0: AB
  10364. 1: A
  10365. 2: B
  10366. MK: A
  10367. XXYZ
  10368. 0: XXY
  10369. 1: <unset>
  10370. 2: <unset>
  10371. 3: X
  10372. 4: X
  10373. 5: Y
  10374. MK: B
  10375. \= Expect no match
  10376. XAQQ
  10377. No match, mark = A
  10378. XAQQXZZ
  10379. No match, mark = A
  10380. AXQQQ
  10381. No match, mark = A
  10382. AXXQQQ
  10383. No match, mark = B
  10384. # Perl doesn't give marks for these, though it does if the alternatives are
  10385. # replaced by single letters.
  10386. /(b|q)(*:m)f|a(*:n)w/mark
  10387. aw
  10388. 0: aw
  10389. MK: n
  10390. \= Expect no match
  10391. abc
  10392. No match, mark = m
  10393. /(q|b)(*:m)f|a(*:n)w/mark
  10394. aw
  10395. 0: aw
  10396. MK: n
  10397. \= Expect no match
  10398. abc
  10399. No match, mark = m
  10400. # After a partial match, the behaviour is as for a failure.
  10401. /^a(*:X)bcde/mark
  10402. abc\=ps
  10403. Partial match, mark=X: abc
  10404. # These are here because Perl doesn't return a mark, except for the first.
  10405. /(?=(*:x))(q|)/aftertext,mark
  10406. abc
  10407. 0:
  10408. 0+ abc
  10409. 1:
  10410. MK: x
  10411. /(?=(*:x))((*:y)q|)/aftertext,mark
  10412. abc
  10413. 0:
  10414. 0+ abc
  10415. 1:
  10416. MK: x
  10417. /(?=(*:x))(?:(*:y)q|)/aftertext,mark
  10418. abc
  10419. 0:
  10420. 0+ abc
  10421. MK: x
  10422. /(?=(*:x))(?>(*:y)q|)/aftertext,mark
  10423. abc
  10424. 0:
  10425. 0+ abc
  10426. MK: x
  10427. /(?=a(*:x))(?!a(*:y)c)/aftertext,mark
  10428. ab
  10429. 0:
  10430. 0+ ab
  10431. MK: x
  10432. /(?=a(*:x))(?=a(*:y)c|)/aftertext,mark
  10433. ab
  10434. 0:
  10435. 0+ ab
  10436. MK: x
  10437. /(..)\1/
  10438. ab\=ps
  10439. Partial match: ab
  10440. aba\=ps
  10441. Partial match: aba
  10442. abab\=ps
  10443. 0: abab
  10444. 1: ab
  10445. /(..)\1/i
  10446. ab\=ps
  10447. Partial match: ab
  10448. abA\=ps
  10449. Partial match: abA
  10450. aBAb\=ps
  10451. 0: aBAb
  10452. 1: aB
  10453. /(..)\1{2,}/
  10454. ab\=ps
  10455. Partial match: ab
  10456. aba\=ps
  10457. Partial match: aba
  10458. abab\=ps
  10459. Partial match: abab
  10460. ababa\=ps
  10461. Partial match: ababa
  10462. ababab\=ps
  10463. 0: ababab
  10464. 1: ab
  10465. ababab\=ph
  10466. Partial match: ababab
  10467. abababa\=ps
  10468. 0: ababab
  10469. 1: ab
  10470. abababa\=ph
  10471. Partial match: abababa
  10472. /(..)\1{2,}/i
  10473. ab\=ps
  10474. Partial match: ab
  10475. aBa\=ps
  10476. Partial match: aBa
  10477. aBAb\=ps
  10478. Partial match: aBAb
  10479. AbaBA\=ps
  10480. Partial match: AbaBA
  10481. abABAb\=ps
  10482. 0: abABAb
  10483. 1: ab
  10484. aBAbaB\=ph
  10485. Partial match: aBAbaB
  10486. abABabA\=ps
  10487. 0: abABab
  10488. 1: ab
  10489. abaBABa\=ph
  10490. Partial match: abaBABa
  10491. /(..)\1{2,}?x/i
  10492. ab\=ps
  10493. Partial match: ab
  10494. abA\=ps
  10495. Partial match: abA
  10496. aBAb\=ps
  10497. Partial match: aBAb
  10498. abaBA\=ps
  10499. Partial match: abaBA
  10500. abAbaB\=ps
  10501. Partial match: abAbaB
  10502. abaBabA\=ps
  10503. Partial match: abaBabA
  10504. abAbABaBx\=ps
  10505. 0: abAbABaBx
  10506. 1: ab
  10507. /^(..)\1/
  10508. aba\=ps
  10509. Partial match: aba
  10510. /^(..)\1{2,3}x/
  10511. aba\=ps
  10512. Partial match: aba
  10513. ababa\=ps
  10514. Partial match: ababa
  10515. ababa\=ph
  10516. Partial match: ababa
  10517. abababx
  10518. 0: abababx
  10519. 1: ab
  10520. ababababx
  10521. 0: ababababx
  10522. 1: ab
  10523. /^(..)\1{2,3}?x/
  10524. aba\=ps
  10525. Partial match: aba
  10526. ababa\=ps
  10527. Partial match: ababa
  10528. ababa\=ph
  10529. Partial match: ababa
  10530. abababx
  10531. 0: abababx
  10532. 1: ab
  10533. ababababx
  10534. 0: ababababx
  10535. 1: ab
  10536. /^(..)(\1{2,3})ab/
  10537. abababab
  10538. 0: abababab
  10539. 1: ab
  10540. 2: abab
  10541. /^\R/
  10542. \r\=ps
  10543. 0: \x0d
  10544. \r\=ph
  10545. Partial match: \x0d
  10546. /^\R{2,3}x/
  10547. \r\=ps
  10548. Partial match: \x0d
  10549. \r\=ph
  10550. Partial match: \x0d
  10551. \r\r\=ps
  10552. Partial match: \x0d\x0d
  10553. \r\r\=ph
  10554. Partial match: \x0d\x0d
  10555. \r\r\r\=ps
  10556. Partial match: \x0d\x0d\x0d
  10557. \r\r\r\=ph
  10558. Partial match: \x0d\x0d\x0d
  10559. \r\rx
  10560. 0: \x0d\x0dx
  10561. \r\r\rx
  10562. 0: \x0d\x0d\x0dx
  10563. /^\R{2,3}?x/
  10564. \r\=ps
  10565. Partial match: \x0d
  10566. \r\=ph
  10567. Partial match: \x0d
  10568. \r\r\=ps
  10569. Partial match: \x0d\x0d
  10570. \r\r\=ph
  10571. Partial match: \x0d\x0d
  10572. \r\r\r\=ps
  10573. Partial match: \x0d\x0d\x0d
  10574. \r\r\r\=ph
  10575. Partial match: \x0d\x0d\x0d
  10576. \r\rx
  10577. 0: \x0d\x0dx
  10578. \r\r\rx
  10579. 0: \x0d\x0d\x0dx
  10580. /^\R?x/
  10581. \r\=ps
  10582. Partial match: \x0d
  10583. \r\=ph
  10584. Partial match: \x0d
  10585. x
  10586. 0: x
  10587. \rx
  10588. 0: \x0dx
  10589. /^\R+x/
  10590. \r\=ps
  10591. Partial match: \x0d
  10592. \r\=ph
  10593. Partial match: \x0d
  10594. \r\n\=ps
  10595. Partial match: \x0d\x0a
  10596. \r\n\=ph
  10597. Partial match: \x0d\x0a
  10598. \rx
  10599. 0: \x0dx
  10600. /^a$/newline=crlf
  10601. a\r\=ps
  10602. Partial match: a\x0d
  10603. a\r\=ph
  10604. Partial match: a\x0d
  10605. /^a$/m,newline=crlf
  10606. a\r\=ps
  10607. Partial match: a\x0d
  10608. a\r\=ph
  10609. Partial match: a\x0d
  10610. /^(a$|a\r)/newline=crlf
  10611. a\r\=ps
  10612. 0: a\x0d
  10613. 1: a\x0d
  10614. a\r\=ph
  10615. Partial match: a\x0d
  10616. /^(a$|a\r)/m,newline=crlf
  10617. a\r\=ps
  10618. 0: a\x0d
  10619. 1: a\x0d
  10620. a\r\=ph
  10621. Partial match: a\x0d
  10622. /./newline=crlf
  10623. \r\=ps
  10624. 0: \x0d
  10625. \r\=ph
  10626. Partial match: \x0d
  10627. /.{2,3}/newline=crlf
  10628. \r\=ps
  10629. Partial match: \x0d
  10630. \r\=ph
  10631. Partial match: \x0d
  10632. \r\r\=ps
  10633. 0: \x0d\x0d
  10634. \r\r\=ph
  10635. Partial match: \x0d\x0d
  10636. \r\r\r\=ps
  10637. 0: \x0d\x0d\x0d
  10638. \r\r\r\=ph
  10639. Partial match: \x0d\x0d\x0d
  10640. /.{2,3}?/newline=crlf
  10641. \r\=ps
  10642. Partial match: \x0d
  10643. \r\=ph
  10644. Partial match: \x0d
  10645. \r\r\=ps
  10646. 0: \x0d\x0d
  10647. \r\r\=ph
  10648. Partial match: \x0d\x0d
  10649. \r\r\r\=ps
  10650. 0: \x0d\x0d
  10651. \r\r\r\=ph
  10652. 0: \x0d\x0d
  10653. "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
  10654. ABCDGHI\=ovector=01
  10655. Matched, but too many substrings
  10656. 0: ABCD
  10657. # These are all run as real matches in test 1; here we are just checking the
  10658. # settings of the anchored and startline bits.
  10659. /(?>.*?a)(?<=ba)/I
  10660. Capture group count = 0
  10661. Max lookbehind = 2
  10662. Last code unit = 'a'
  10663. Subject length lower bound = 1
  10664. /(?:.*?a)(?<=ba)/I
  10665. Capture group count = 0
  10666. Max lookbehind = 2
  10667. First code unit at start or follows newline
  10668. Last code unit = 'a'
  10669. Subject length lower bound = 1
  10670. /.*?a(*PRUNE)b/I
  10671. Capture group count = 0
  10672. Last code unit = 'b'
  10673. Subject length lower bound = 2
  10674. /.*?a(*PRUNE)b/Is
  10675. Capture group count = 0
  10676. Options: dotall
  10677. Last code unit = 'b'
  10678. Subject length lower bound = 2
  10679. /^a(*PRUNE)b/Is
  10680. Capture group count = 0
  10681. Compile options: dotall
  10682. Overall options: anchored dotall
  10683. First code unit = 'a'
  10684. Subject length lower bound = 2
  10685. /.*?a(*SKIP)b/I
  10686. Capture group count = 0
  10687. Last code unit = 'b'
  10688. Subject length lower bound = 2
  10689. /(?>.*?a)b/Is
  10690. Capture group count = 0
  10691. Options: dotall
  10692. Last code unit = 'b'
  10693. Subject length lower bound = 2
  10694. /(?>.*?a)b/I
  10695. Capture group count = 0
  10696. Last code unit = 'b'
  10697. Subject length lower bound = 2
  10698. /(?>^a)b/Is
  10699. Capture group count = 0
  10700. Compile options: dotall
  10701. Overall options: anchored dotall
  10702. First code unit = 'a'
  10703. Subject length lower bound = 2
  10704. /(?>.*?)(?<=(abcd)|(wxyz))/I
  10705. Capture group count = 2
  10706. Max lookbehind = 4
  10707. May match empty string
  10708. Subject length lower bound = 0
  10709. /(?>.*)(?<=(abcd)|(wxyz))/I
  10710. Capture group count = 2
  10711. Max lookbehind = 4
  10712. May match empty string
  10713. Subject length lower bound = 0
  10714. "(?>.*)foo"I
  10715. Capture group count = 0
  10716. Last code unit = 'o'
  10717. Subject length lower bound = 3
  10718. "(?>.*?)foo"I
  10719. Capture group count = 0
  10720. Last code unit = 'o'
  10721. Subject length lower bound = 3
  10722. /(?>^abc)/Im
  10723. Capture group count = 0
  10724. Options: multiline
  10725. First code unit at start or follows newline
  10726. Last code unit = 'c'
  10727. Subject length lower bound = 3
  10728. /(?>.*abc)/Im
  10729. Capture group count = 0
  10730. Options: multiline
  10731. Last code unit = 'c'
  10732. Subject length lower bound = 3
  10733. /(?:.*abc)/Im
  10734. Capture group count = 0
  10735. Options: multiline
  10736. First code unit at start or follows newline
  10737. Last code unit = 'c'
  10738. Subject length lower bound = 3
  10739. /(?:(a)+(?C1)bb|aa(?C2)b)/
  10740. aab\=callout_capture
  10741. Callout 1: last capture = 1
  10742. 1: a
  10743. --->aab
  10744. ^ ^ b
  10745. Callout 1: last capture = 1
  10746. 1: a
  10747. --->aab
  10748. ^^ b
  10749. Callout 2: last capture = 0
  10750. --->aab
  10751. ^ ^ b
  10752. 0: aab
  10753. /(?:(a)++(?C1)bb|aa(?C2)b)/
  10754. aab\=callout_capture
  10755. Callout 1: last capture = 1
  10756. 1: a
  10757. --->aab
  10758. ^ ^ b
  10759. Callout 2: last capture = 0
  10760. --->aab
  10761. ^ ^ b
  10762. 0: aab
  10763. /(?:(?>(a))(?C1)bb|aa(?C2)b)/
  10764. aab\=callout_capture
  10765. Callout 1: last capture = 1
  10766. 1: a
  10767. --->aab
  10768. ^^ b
  10769. Callout 2: last capture = 0
  10770. --->aab
  10771. ^ ^ b
  10772. 0: aab
  10773. /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
  10774. aab\=callout_capture
  10775. Callout 1: last capture = 0
  10776. --->aab
  10777. ^^ x
  10778. Callout 1: last capture = 0
  10779. --->aab
  10780. ^^ x
  10781. Callout 2: last capture = 0
  10782. --->aab
  10783. ^ ^ )
  10784. 0: ab
  10785. /(?1)(?C1)((a)(?C2)){0}/
  10786. aab\=callout_capture
  10787. Callout 2: last capture = 2
  10788. 1: <unset>
  10789. 2: a
  10790. --->aab
  10791. ^^ ){0}
  10792. Callout 1: last capture = 0
  10793. --->aab
  10794. ^^ (
  10795. 0: a
  10796. /(?:(a)+(?C1)bb|aa(?C2)b)++/
  10797. aab\=callout_capture
  10798. Callout 1: last capture = 1
  10799. 1: a
  10800. --->aab
  10801. ^ ^ b
  10802. Callout 1: last capture = 1
  10803. 1: a
  10804. --->aab
  10805. ^^ b
  10806. Callout 2: last capture = 0
  10807. --->aab
  10808. ^ ^ b
  10809. 0: aab
  10810. aab\=callout_capture,ovector=1
  10811. Callout 1: last capture = 1
  10812. 1: a
  10813. --->aab
  10814. ^ ^ b
  10815. Callout 1: last capture = 1
  10816. 1: a
  10817. --->aab
  10818. ^^ b
  10819. Callout 2: last capture = 0
  10820. --->aab
  10821. ^ ^ b
  10822. 0: aab
  10823. /(ab)x|ab/
  10824. ab\=ovector=0
  10825. 0: ab
  10826. ab\=ovector=1
  10827. 0: ab
  10828. /(?<=123)(*MARK:xx)abc/mark
  10829. xxxx123a\=ph
  10830. Partial match, mark=xx: a
  10831. xxxx123a\=ps
  10832. Partial match, mark=xx: a
  10833. /123\Kabc/startchar
  10834. xxxx123a\=ph
  10835. Partial match: 123a
  10836. xxxx123a\=ps
  10837. Partial match: 123a
  10838. /^(?(?=a)aa|bb)/auto_callout
  10839. bb
  10840. --->bb
  10841. +0 ^ ^
  10842. +1 ^ (?
  10843. +3 ^ (?=
  10844. +6 ^ a
  10845. +11 ^ b
  10846. +12 ^^ b
  10847. +13 ^ ^ )
  10848. +14 ^ ^ End of pattern
  10849. 0: bb
  10850. /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
  10851. bb
  10852. --->bb
  10853. 1 ^ ^
  10854. 2 ^ (?
  10855. 99 ^ (?=
  10856. 3 ^ a
  10857. 8 ^ b
  10858. 9 ^^ b
  10859. 10 ^ ^ )
  10860. 11 ^ ^ End of pattern
  10861. 0: bb
  10862. # Perl seems to have a bug with this one.
  10863. /aaaaa(*COMMIT)(*PRUNE)b|a+c/
  10864. aaaaaac
  10865. 0: aaaac
  10866. # Here are some that Perl treats differently because of the way it handles
  10867. # backtracking verbs.
  10868. /(?!a(*COMMIT)b)ac|ad/
  10869. ac
  10870. 0: ac
  10871. ad
  10872. 0: ad
  10873. /^(?!a(*THEN)b|ac)../
  10874. ad
  10875. 0: ad
  10876. \= Expect no match
  10877. ac
  10878. No match
  10879. /^(?=a(*THEN)b|ac)/
  10880. ac
  10881. 0:
  10882. /\A.*?(?:a|b(*THEN)c)/
  10883. ba
  10884. 0: ba
  10885. /\A.*?(?:a|b(*THEN)c)++/
  10886. ba
  10887. 0: ba
  10888. /\A.*?(?:a|b(*THEN)c|d)/
  10889. ba
  10890. 0: ba
  10891. /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
  10892. aac
  10893. 0: aac
  10894. /\A.*?(a|b(*THEN)c)/
  10895. ba
  10896. 0: ba
  10897. 1: a
  10898. /^(A(*THEN)B|A(*THEN)D)/
  10899. AD
  10900. 0: AD
  10901. 1: AD
  10902. /(?!b(*THEN)a)bn|bnn/
  10903. bnn
  10904. 0: bn
  10905. /(?(?=b(*SKIP)a)bn|bnn)/
  10906. bnn
  10907. 0: bnn
  10908. /(?=b(*THEN)a|)bn|bnn/
  10909. bnn
  10910. 0: bn
  10911. # This test causes a segfault with Perl 5.18.0
  10912. /^(?=(a)){0}b(?1)/
  10913. backgammon
  10914. 0: ba
  10915. /(?|(?<n>f)|(?<n>b))/I,dupnames
  10916. Capture group count = 1
  10917. Named capture groups:
  10918. n 1
  10919. Options: dupnames
  10920. Starting code units: b f
  10921. Subject length lower bound = 1
  10922. /(?<a>abc)(?<a>z)\k<a>()/IB,dupnames
  10923. ------------------------------------------------------------------
  10924. Bra
  10925. CBra 1
  10926. abc
  10927. Ket
  10928. CBra 2
  10929. z
  10930. Ket
  10931. \k<a>2
  10932. CBra 3
  10933. Ket
  10934. Ket
  10935. End
  10936. ------------------------------------------------------------------
  10937. Capture group count = 3
  10938. Max back reference = 2
  10939. Named capture groups:
  10940. a 1
  10941. a 2
  10942. Options: dupnames
  10943. First code unit = 'a'
  10944. Last code unit = 'z'
  10945. Subject length lower bound = 5
  10946. /a*[bcd]/B
  10947. ------------------------------------------------------------------
  10948. Bra
  10949. a*+
  10950. [b-d]
  10951. Ket
  10952. End
  10953. ------------------------------------------------------------------
  10954. /[bcd]*a/B
  10955. ------------------------------------------------------------------
  10956. Bra
  10957. [b-d]*+
  10958. a
  10959. Ket
  10960. End
  10961. ------------------------------------------------------------------
  10962. # A complete set of tests for auto-possessification of character types, but
  10963. # omitting \C because it might be disabled (it has its own tests).
  10964. /\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
  10965. ------------------------------------------------------------------
  10966. Bra
  10967. \D+
  10968. \D
  10969. \D++
  10970. \d
  10971. \D+
  10972. \S
  10973. \D+
  10974. \s
  10975. \D+
  10976. \W
  10977. \D+
  10978. \w
  10979. \D+
  10980. Any
  10981. \D+
  10982. \R
  10983. \D+
  10984. \H
  10985. \D+
  10986. \h
  10987. \D+
  10988. \V
  10989. \D+
  10990. \v
  10991. \D+
  10992. \Z
  10993. \D++
  10994. \z
  10995. \D+
  10996. $
  10997. Ket
  10998. End
  10999. ------------------------------------------------------------------
  11000. /\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
  11001. ------------------------------------------------------------------
  11002. Bra
  11003. \d++
  11004. \D
  11005. \d+
  11006. \d
  11007. \d+
  11008. \S
  11009. \d++
  11010. \s
  11011. \d++
  11012. \W
  11013. \d+
  11014. \w
  11015. \d+
  11016. Any
  11017. \d++
  11018. \R
  11019. \d+
  11020. \H
  11021. \d++
  11022. \h
  11023. \d+
  11024. \V
  11025. \d++
  11026. \v
  11027. \d++
  11028. \Z
  11029. \d++
  11030. \z
  11031. \d++
  11032. $
  11033. Ket
  11034. End
  11035. ------------------------------------------------------------------
  11036. /\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
  11037. ------------------------------------------------------------------
  11038. Bra
  11039. \S+
  11040. \D
  11041. \S+
  11042. \d
  11043. \S+
  11044. \S
  11045. \S++
  11046. \s
  11047. \S+
  11048. \W
  11049. \S+
  11050. \w
  11051. \S+
  11052. Any
  11053. \S++
  11054. \R
  11055. \S+
  11056. \H
  11057. \S++
  11058. \h
  11059. \S+
  11060. \V
  11061. \S++
  11062. \v
  11063. \S++
  11064. \Z
  11065. \S++
  11066. \z
  11067. \S++
  11068. $
  11069. Ket
  11070. End
  11071. ------------------------------------------------------------------
  11072. /\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
  11073. ------------------------------------------------------------------
  11074. Bra
  11075. \s+
  11076. \D
  11077. \s++
  11078. \d
  11079. \s++
  11080. \S
  11081. \s+
  11082. \s
  11083. \s+
  11084. \W
  11085. \s++
  11086. \w
  11087. \s+
  11088. Any
  11089. \s+
  11090. \R
  11091. \s+
  11092. \H
  11093. \s+
  11094. \h
  11095. \s+
  11096. \V
  11097. \s+
  11098. \v
  11099. \s+
  11100. \Z
  11101. \s++
  11102. \z
  11103. \s+
  11104. $
  11105. Ket
  11106. End
  11107. ------------------------------------------------------------------
  11108. /\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
  11109. ------------------------------------------------------------------
  11110. Bra
  11111. \W+
  11112. \D
  11113. \W++
  11114. \d
  11115. \W+
  11116. \S
  11117. \W+
  11118. \s
  11119. \W+
  11120. \W
  11121. \W++
  11122. \w
  11123. \W+
  11124. Any
  11125. \W+
  11126. \R
  11127. \W+
  11128. \H
  11129. \W+
  11130. \h
  11131. \W+
  11132. \V
  11133. \W+
  11134. \v
  11135. \W+
  11136. \Z
  11137. \W++
  11138. \z
  11139. \W+
  11140. $
  11141. Ket
  11142. End
  11143. ------------------------------------------------------------------
  11144. /\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
  11145. ------------------------------------------------------------------
  11146. Bra
  11147. \w+
  11148. \D
  11149. \w+
  11150. \d
  11151. \w+
  11152. \S
  11153. \w++
  11154. \s
  11155. \w++
  11156. \W
  11157. \w+
  11158. \w
  11159. \w+
  11160. Any
  11161. \w++
  11162. \R
  11163. \w+
  11164. \H
  11165. \w++
  11166. \h
  11167. \w+
  11168. \V
  11169. \w++
  11170. \v
  11171. \w++
  11172. \Z
  11173. \w++
  11174. \z
  11175. \w++
  11176. $
  11177. Ket
  11178. End
  11179. ------------------------------------------------------------------
  11180. /\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
  11181. ------------------------------------------------------------------
  11182. Bra
  11183. \R+
  11184. \D
  11185. \R++
  11186. \d
  11187. \R+
  11188. \S
  11189. \R++
  11190. \s
  11191. \R+
  11192. \W
  11193. \R++
  11194. \w
  11195. \R++
  11196. Any
  11197. \R+
  11198. \R
  11199. \R+
  11200. \H
  11201. \R++
  11202. \h
  11203. \R+
  11204. \V
  11205. \R+
  11206. \v
  11207. \R+
  11208. \Z
  11209. \R++
  11210. \z
  11211. \R+
  11212. $
  11213. Ket
  11214. End
  11215. ------------------------------------------------------------------
  11216. /\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
  11217. ------------------------------------------------------------------
  11218. Bra
  11219. \H+
  11220. \D
  11221. \H+
  11222. \d
  11223. \H+
  11224. \S
  11225. \H+
  11226. \s
  11227. \H+
  11228. \W
  11229. \H+
  11230. \w
  11231. \H+
  11232. Any
  11233. \H+
  11234. \R
  11235. \H+
  11236. \H
  11237. \H++
  11238. \h
  11239. \H+
  11240. \V
  11241. \H+
  11242. \v
  11243. \H+
  11244. \Z
  11245. \H++
  11246. \z
  11247. \H+
  11248. $
  11249. Ket
  11250. End
  11251. ------------------------------------------------------------------
  11252. /\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
  11253. ------------------------------------------------------------------
  11254. Bra
  11255. \h+
  11256. \D
  11257. \h++
  11258. \d
  11259. \h++
  11260. \S
  11261. \h+
  11262. \s
  11263. \h+
  11264. \W
  11265. \h++
  11266. \w
  11267. \h+
  11268. Any
  11269. \h++
  11270. \R
  11271. \h++
  11272. \H
  11273. \h+
  11274. \h
  11275. \h+
  11276. \V
  11277. \h++
  11278. \v
  11279. \h+
  11280. \Z
  11281. \h++
  11282. \z
  11283. \h+
  11284. $
  11285. Ket
  11286. End
  11287. ------------------------------------------------------------------
  11288. /\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
  11289. ------------------------------------------------------------------
  11290. Bra
  11291. \V+
  11292. \D
  11293. \V+
  11294. \d
  11295. \V+
  11296. \S
  11297. \V+
  11298. \s
  11299. \V+
  11300. \W
  11301. \V+
  11302. \w
  11303. \V+
  11304. Any
  11305. \V++
  11306. \R
  11307. \V+
  11308. \H
  11309. \V+
  11310. \h
  11311. \V+
  11312. \V
  11313. \V++
  11314. \v
  11315. \V+
  11316. \Z
  11317. \V++
  11318. \z
  11319. \V+
  11320. $
  11321. Ket
  11322. End
  11323. ------------------------------------------------------------------
  11324. /\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
  11325. ------------------------------------------------------------------
  11326. Bra
  11327. \v+
  11328. \D
  11329. \v++
  11330. \d
  11331. \v++
  11332. \S
  11333. \v+
  11334. \s
  11335. \v+
  11336. \W
  11337. \v++
  11338. \w
  11339. \v+
  11340. Any
  11341. \v+
  11342. \R
  11343. \v+
  11344. \H
  11345. \v++
  11346. \h
  11347. \v++
  11348. \V
  11349. \v+
  11350. \v
  11351. \v+
  11352. \Z
  11353. \v++
  11354. \z
  11355. \v+
  11356. $
  11357. Ket
  11358. End
  11359. ------------------------------------------------------------------
  11360. / a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/Bx
  11361. ------------------------------------------------------------------
  11362. Bra
  11363. a+
  11364. \D
  11365. a++
  11366. \d
  11367. a+
  11368. \S
  11369. a++
  11370. \s
  11371. a++
  11372. \W
  11373. a+
  11374. \w
  11375. a+
  11376. Any
  11377. a++
  11378. \R
  11379. a+
  11380. \H
  11381. a++
  11382. \h
  11383. a+
  11384. \V
  11385. a++
  11386. \v
  11387. a++
  11388. \Z
  11389. a++
  11390. \z
  11391. a++
  11392. $
  11393. Ket
  11394. End
  11395. ------------------------------------------------------------------
  11396. /\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
  11397. ------------------------------------------------------------------
  11398. Bra
  11399. \x0a+
  11400. \D
  11401. \x0a++
  11402. \d
  11403. \x0a++
  11404. \S
  11405. \x0a+
  11406. \s
  11407. \x0a+
  11408. \W
  11409. \x0a++
  11410. \w
  11411. \x0a+
  11412. Any
  11413. \x0a+
  11414. \R
  11415. \x0a+
  11416. \H
  11417. \x0a++
  11418. \h
  11419. \x0a++
  11420. \V
  11421. \x0a+
  11422. \v
  11423. \x0a+
  11424. \Z
  11425. \x0a++
  11426. \z
  11427. \x0a+
  11428. $
  11429. Ket
  11430. End
  11431. ------------------------------------------------------------------
  11432. / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bx
  11433. ------------------------------------------------------------------
  11434. Bra
  11435. Any+
  11436. \D
  11437. Any+
  11438. \d
  11439. Any+
  11440. \S
  11441. Any+
  11442. \s
  11443. Any+
  11444. \W
  11445. Any+
  11446. \w
  11447. Any+
  11448. Any
  11449. Any++
  11450. \R
  11451. Any+
  11452. \H
  11453. Any+
  11454. \h
  11455. Any+
  11456. \V
  11457. Any+
  11458. \v
  11459. Any+
  11460. \Z
  11461. Any++
  11462. \z
  11463. Any+
  11464. $
  11465. Ket
  11466. End
  11467. ------------------------------------------------------------------
  11468. / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bsx
  11469. ------------------------------------------------------------------
  11470. Bra
  11471. AllAny+
  11472. \D
  11473. AllAny+
  11474. \d
  11475. AllAny+
  11476. \S
  11477. AllAny+
  11478. \s
  11479. AllAny+
  11480. \W
  11481. AllAny+
  11482. \w
  11483. AllAny+
  11484. AllAny
  11485. AllAny+
  11486. \R
  11487. AllAny+
  11488. \H
  11489. AllAny+
  11490. \h
  11491. AllAny+
  11492. \V
  11493. AllAny+
  11494. \v
  11495. AllAny+
  11496. \Z
  11497. AllAny++
  11498. \z
  11499. AllAny+
  11500. $
  11501. Ket
  11502. End
  11503. ------------------------------------------------------------------
  11504. / \D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/Bmx
  11505. ------------------------------------------------------------------
  11506. Bra
  11507. \D+
  11508. /m $
  11509. \d++
  11510. /m $
  11511. \S++
  11512. /m $
  11513. \s+
  11514. /m $
  11515. \W+
  11516. /m $
  11517. \w++
  11518. /m $
  11519. \R+
  11520. /m $
  11521. \H+
  11522. /m $
  11523. \h+
  11524. /m $
  11525. \V+
  11526. /m $
  11527. \v+
  11528. /m $
  11529. a+
  11530. /m $
  11531. \x0a+
  11532. /m $
  11533. Any+
  11534. /m $
  11535. Any+
  11536. /m $
  11537. Ket
  11538. End
  11539. ------------------------------------------------------------------
  11540. /(?=a+)a(a+)++a/B
  11541. ------------------------------------------------------------------
  11542. Bra
  11543. Assert
  11544. a++
  11545. Ket
  11546. a
  11547. CBraPos 1
  11548. a+
  11549. KetRpos
  11550. a
  11551. Ket
  11552. End
  11553. ------------------------------------------------------------------
  11554. /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/B
  11555. ------------------------------------------------------------------
  11556. Bra
  11557. a++
  11558. CBra 1
  11559. bb
  11560. Alt
  11561. cc
  11562. Ket
  11563. a++
  11564. Bra
  11565. bb
  11566. Alt
  11567. cc
  11568. Ket
  11569. a++
  11570. Once
  11571. bb
  11572. Alt
  11573. cc
  11574. Ket
  11575. a++
  11576. Bra
  11577. bb
  11578. Alt
  11579. cc
  11580. KetRmax
  11581. a+
  11582. CBra 2
  11583. aa
  11584. Ket
  11585. a+
  11586. Bra
  11587. bb
  11588. Alt
  11589. aa
  11590. Ket
  11591. Ket
  11592. End
  11593. ------------------------------------------------------------------
  11594. /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/B
  11595. ------------------------------------------------------------------
  11596. Bra
  11597. a++
  11598. Brazero
  11599. CBra 1
  11600. bb
  11601. Alt
  11602. cc
  11603. Ket
  11604. #
  11605. a++
  11606. Braminzero
  11607. Bra
  11608. bb
  11609. Alt
  11610. cc
  11611. Ket
  11612. #
  11613. a++
  11614. Once
  11615. Brazero
  11616. Bra
  11617. bb
  11618. Alt
  11619. cc
  11620. Ket
  11621. Ket
  11622. #
  11623. a++
  11624. Brazero
  11625. Bra
  11626. bb
  11627. Alt
  11628. cc
  11629. KetRmax
  11630. #
  11631. a+
  11632. Brazero
  11633. CBra 2
  11634. bb
  11635. Alt
  11636. cc
  11637. Ket
  11638. a#
  11639. a+
  11640. Brazero
  11641. Bra
  11642. aa
  11643. Ket
  11644. Ket
  11645. End
  11646. ------------------------------------------------------------------
  11647. /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/B
  11648. ------------------------------------------------------------------
  11649. Bra
  11650. a+
  11651. Brazero
  11652. Bra
  11653. bb
  11654. Ket
  11655. a#
  11656. a++
  11657. Bra
  11658. Alt
  11659. Alt
  11660. Alt
  11661. Ket
  11662. #
  11663. a+
  11664. Bra
  11665. Alt
  11666. b
  11667. Ket
  11668. a#
  11669. a+
  11670. Brazero
  11671. Bra
  11672. Alt
  11673. Alt
  11674. Alt
  11675. Ket
  11676. a
  11677. Ket
  11678. End
  11679. ------------------------------------------------------------------
  11680. /[ab]*/B
  11681. ------------------------------------------------------------------
  11682. Bra
  11683. [ab]*+
  11684. Ket
  11685. End
  11686. ------------------------------------------------------------------
  11687. aaaa
  11688. 0: aaaa
  11689. /[ab]*?/B
  11690. ------------------------------------------------------------------
  11691. Bra
  11692. [ab]*?
  11693. Ket
  11694. End
  11695. ------------------------------------------------------------------
  11696. aaaa
  11697. 0:
  11698. /[ab]?/B
  11699. ------------------------------------------------------------------
  11700. Bra
  11701. [ab]?+
  11702. Ket
  11703. End
  11704. ------------------------------------------------------------------
  11705. aaaa
  11706. 0: a
  11707. /[ab]??/B
  11708. ------------------------------------------------------------------
  11709. Bra
  11710. [ab]??
  11711. Ket
  11712. End
  11713. ------------------------------------------------------------------
  11714. aaaa
  11715. 0:
  11716. /[ab]+/B
  11717. ------------------------------------------------------------------
  11718. Bra
  11719. [ab]++
  11720. Ket
  11721. End
  11722. ------------------------------------------------------------------
  11723. aaaa
  11724. 0: aaaa
  11725. /[ab]+?/B
  11726. ------------------------------------------------------------------
  11727. Bra
  11728. [ab]+?
  11729. Ket
  11730. End
  11731. ------------------------------------------------------------------
  11732. aaaa
  11733. 0: a
  11734. /[ab]{2,3}/B
  11735. ------------------------------------------------------------------
  11736. Bra
  11737. [ab]{2,3}+
  11738. Ket
  11739. End
  11740. ------------------------------------------------------------------
  11741. aaaa
  11742. 0: aaa
  11743. /[ab]{2,3}?/B
  11744. ------------------------------------------------------------------
  11745. Bra
  11746. [ab]{2,3}?
  11747. Ket
  11748. End
  11749. ------------------------------------------------------------------
  11750. aaaa
  11751. 0: aa
  11752. /[ab]{2,}/B
  11753. ------------------------------------------------------------------
  11754. Bra
  11755. [ab]{2,}+
  11756. Ket
  11757. End
  11758. ------------------------------------------------------------------
  11759. aaaa
  11760. 0: aaaa
  11761. /[ab]{2,}?/B
  11762. ------------------------------------------------------------------
  11763. Bra
  11764. [ab]{2,}?
  11765. Ket
  11766. End
  11767. ------------------------------------------------------------------
  11768. aaaa
  11769. 0: aa
  11770. /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/B
  11771. ------------------------------------------------------------------
  11772. Bra
  11773. \d++
  11774. \s{0,5}+
  11775. =
  11776. \s*+
  11777. \S?
  11778. =
  11779. \w{0,4}+
  11780. \W*+
  11781. Ket
  11782. End
  11783. ------------------------------------------------------------------
  11784. /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/B
  11785. ------------------------------------------------------------------
  11786. Bra
  11787. [a-d]{5,12}+
  11788. [0-9e-z]*+
  11789. #
  11790. [\x00-`{-\xff] (neg)++
  11791. [b-y]*+
  11792. a
  11793. [2-7]?+
  11794. [\x00-/:-`{-\xff] (neg)++
  11795. Ket
  11796. End
  11797. ------------------------------------------------------------------
  11798. /[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/B
  11799. ------------------------------------------------------------------
  11800. Bra
  11801. [a-z]*+
  11802. \s
  11803. #
  11804. [\x09 ]?+
  11805. \S
  11806. #
  11807. [a-c]*
  11808. \S
  11809. #
  11810. [C-G]++
  11811. \d
  11812. #
  11813. [4-8]*+
  11814. \D
  11815. #
  11816. [,4-9]*
  11817. \D
  11818. #
  11819. [!$]{0,5}+
  11820. \w
  11821. #
  11822. [M-Xf-l]++
  11823. \W
  11824. #
  11825. [,a-c]?
  11826. \W
  11827. Ket
  11828. End
  11829. ------------------------------------------------------------------
  11830. /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/B
  11831. ------------------------------------------------------------------
  11832. Bra
  11833. a+
  11834. Brazero
  11835. CBra 1
  11836. aa
  11837. Alt
  11838. bb
  11839. KetRmax
  11840. c#
  11841. a*
  11842. Brazero
  11843. CBra 2
  11844. bb
  11845. Alt
  11846. cc
  11847. KetRmax
  11848. a#
  11849. a?+
  11850. Brazero
  11851. CBra 3
  11852. bb
  11853. Alt
  11854. cc
  11855. KetRmax
  11856. d#
  11857. [a-f]*
  11858. Brazero
  11859. CBra 4
  11860. g
  11861. Alt
  11862. hh
  11863. KetRmax
  11864. f
  11865. Ket
  11866. End
  11867. ------------------------------------------------------------------
  11868. /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/B
  11869. ------------------------------------------------------------------
  11870. Bra
  11871. [a-f]*+
  11872. Brazero
  11873. CBra 1
  11874. g
  11875. Alt
  11876. hh
  11877. Alt
  11878. i
  11879. KetRmax
  11880. i#
  11881. [a-x]{4,}
  11882. Brazero
  11883. SCBra 2
  11884. y{0,6}
  11885. KetRmax
  11886. y#
  11887. [a-k]++
  11888. CBra 3
  11889. ll
  11890. Alt
  11891. mm
  11892. KetRmax
  11893. n
  11894. Ket
  11895. End
  11896. ------------------------------------------------------------------
  11897. /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/B
  11898. ------------------------------------------------------------------
  11899. Bra
  11900. [a-f]*+
  11901. Once
  11902. gg
  11903. Alt
  11904. hh
  11905. KetRmax
  11906. #
  11907. [a-f]*+
  11908. Brazero
  11909. Once
  11910. gg
  11911. Alt
  11912. hh
  11913. Ket
  11914. #
  11915. [a-f]*
  11916. Brazero
  11917. Once
  11918. gg
  11919. Alt
  11920. hh
  11921. KetRmax
  11922. a#
  11923. [a-f]*+
  11924. Brazero
  11925. Once
  11926. gg
  11927. Alt
  11928. hh
  11929. KetRmax
  11930. h
  11931. Ket
  11932. End
  11933. ------------------------------------------------------------------
  11934. /[a-c]*d/IB
  11935. ------------------------------------------------------------------
  11936. Bra
  11937. [a-c]*+
  11938. d
  11939. Ket
  11940. End
  11941. ------------------------------------------------------------------
  11942. Capture group count = 0
  11943. Starting code units: a b c d
  11944. Last code unit = 'd'
  11945. Subject length lower bound = 1
  11946. /[a-c]+d/IB
  11947. ------------------------------------------------------------------
  11948. Bra
  11949. [a-c]++
  11950. d
  11951. Ket
  11952. End
  11953. ------------------------------------------------------------------
  11954. Capture group count = 0
  11955. Starting code units: a b c
  11956. Last code unit = 'd'
  11957. Subject length lower bound = 2
  11958. /[a-c]?d/IB
  11959. ------------------------------------------------------------------
  11960. Bra
  11961. [a-c]?+
  11962. d
  11963. Ket
  11964. End
  11965. ------------------------------------------------------------------
  11966. Capture group count = 0
  11967. Starting code units: a b c d
  11968. Last code unit = 'd'
  11969. Subject length lower bound = 1
  11970. /[a-c]{4,6}d/IB
  11971. ------------------------------------------------------------------
  11972. Bra
  11973. [a-c]{4,6}+
  11974. d
  11975. Ket
  11976. End
  11977. ------------------------------------------------------------------
  11978. Capture group count = 0
  11979. Starting code units: a b c
  11980. Last code unit = 'd'
  11981. Subject length lower bound = 5
  11982. /[a-c]{0,6}d/IB
  11983. ------------------------------------------------------------------
  11984. Bra
  11985. [a-c]{0,6}+
  11986. d
  11987. Ket
  11988. End
  11989. ------------------------------------------------------------------
  11990. Capture group count = 0
  11991. Starting code units: a b c d
  11992. Last code unit = 'd'
  11993. Subject length lower bound = 1
  11994. # End of special auto-possessive tests
  11995. /^A\o{1239}B/
  11996. Failed: error 164 at offset 8: non-octal character in \o{} (closing brace missing?)
  11997. A\123B
  11998. /^A\oB/
  11999. Failed: error 155 at offset 4: missing opening brace after \o
  12000. /^A\x{zz}B/
  12001. Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing?)
  12002. /^A\x{12Z/
  12003. Failed: error 167 at offset 7: non-hex character in \x{} (closing brace missing?)
  12004. /^A\x{/
  12005. Failed: error 178 at offset 5: digits missing in \x{} or \o{} or \N{U+}
  12006. /[ab]++/B,no_auto_possess
  12007. ------------------------------------------------------------------
  12008. Bra
  12009. [ab]++
  12010. Ket
  12011. End
  12012. ------------------------------------------------------------------
  12013. /[^ab]*+/B,no_auto_possess
  12014. ------------------------------------------------------------------
  12015. Bra
  12016. [\x00-`c-\xff] (neg)*+
  12017. Ket
  12018. End
  12019. ------------------------------------------------------------------
  12020. /a{4}+/B,no_auto_possess
  12021. ------------------------------------------------------------------
  12022. Bra
  12023. a{4}
  12024. Ket
  12025. End
  12026. ------------------------------------------------------------------
  12027. /a{4}+/Bi,no_auto_possess
  12028. ------------------------------------------------------------------
  12029. Bra
  12030. /i a{4}
  12031. Ket
  12032. End
  12033. ------------------------------------------------------------------
  12034. /[a-[:digit:]]+/
  12035. Failed: error 150 at offset 4: invalid range in character class
  12036. /[A-[:digit:]]+/
  12037. Failed: error 150 at offset 4: invalid range in character class
  12038. /[a-[.xxx.]]+/
  12039. Failed: error 150 at offset 4: invalid range in character class
  12040. /[a-[=xxx=]]+/
  12041. Failed: error 150 at offset 4: invalid range in character class
  12042. /[a-[!xxx!]]+/
  12043. Failed: error 108 at offset 3: range out of order in character class
  12044. /[A-[!xxx!]]+/
  12045. A]]]
  12046. 0: A]]]
  12047. /[a-\d]+/
  12048. Failed: error 150 at offset 5: invalid range in character class
  12049. /(?<0abc>xx)/
  12050. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12051. /(?&1abc)xx(?<1abc>y)/
  12052. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12053. /(?<ab-cd>xx)/
  12054. Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
  12055. /(?'0abc'xx)/
  12056. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12057. /(?P<0abc>xx)/
  12058. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12059. /\k<5ghj>/
  12060. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12061. /\k'5ghj'/
  12062. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12063. /\k{2fgh}/
  12064. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12065. /(?P=8yuki)/
  12066. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12067. /\g{4df}/
  12068. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12069. /(?&1abc)xx(?<1abc>y)/
  12070. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12071. /(?P>1abc)xx(?<1abc>y)/
  12072. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12073. /\g'3gh'/
  12074. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12075. /\g<5fg>/
  12076. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12077. /(?(<4gh>)abc)/
  12078. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12079. /(?('4gh')abc)/
  12080. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12081. /(?(4gh)abc)/
  12082. Failed: error 124 at offset 4: missing closing parenthesis for condition
  12083. /(?(R&6yh)abc)/
  12084. Failed: error 144 at offset 5: subpattern name must start with a non-digit
  12085. /(((a\2)|(a*)\g<-1>))*a?/B
  12086. ------------------------------------------------------------------
  12087. Bra
  12088. Brazero
  12089. SCBra 1
  12090. CBra 2
  12091. CBra 3
  12092. a
  12093. \2
  12094. Ket
  12095. Alt
  12096. CBra 4
  12097. a*
  12098. Ket
  12099. Recurse
  12100. Ket
  12101. KetRmax
  12102. a?+
  12103. Ket
  12104. End
  12105. ------------------------------------------------------------------
  12106. # Test the ugly "start or end of word" compatibility syntax.
  12107. /[[:<:]]red[[:>:]]/B
  12108. ------------------------------------------------------------------
  12109. Bra
  12110. \b
  12111. Assert
  12112. \w
  12113. Ket
  12114. red
  12115. \b
  12116. Assert back
  12117. Reverse
  12118. \w
  12119. Ket
  12120. Ket
  12121. End
  12122. ------------------------------------------------------------------
  12123. little red riding hood
  12124. 0: red
  12125. a /red/ thing
  12126. 0: red
  12127. red is a colour
  12128. 0: red
  12129. put it all on red
  12130. 0: red
  12131. \= Expect no match
  12132. no reduction
  12133. No match
  12134. Alfred Winifred
  12135. No match
  12136. /[a[:<:]] should give error/
  12137. Failed: error 130 at offset 4: unknown POSIX class name
  12138. /(?=ab\K)/aftertext,allow_lookaround_bsk
  12139. abcd\=startchar
  12140. Start of matched string is beyond its end - displaying from end to start.
  12141. 0: ab
  12142. 0+ abcd
  12143. /abcd/newline=lf,firstline
  12144. \= Expect no match
  12145. xx\nxabcd
  12146. No match
  12147. # Test stack guard external calls.
  12148. /(((a)))/stackguard=1
  12149. Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
  12150. /(((a)))/stackguard=2
  12151. Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
  12152. /(((a)))/stackguard=3
  12153. /(((((a)))))/
  12154. # End stack guard tests
  12155. /^\w+(?>\s*)(?<=\w)/B
  12156. ------------------------------------------------------------------
  12157. Bra
  12158. ^
  12159. \w+
  12160. Once
  12161. \s*+
  12162. Ket
  12163. Assert back
  12164. Reverse
  12165. \w
  12166. Ket
  12167. Ket
  12168. End
  12169. ------------------------------------------------------------------
  12170. /\othing/
  12171. Failed: error 155 at offset 2: missing opening brace after \o
  12172. /\o{}/
  12173. Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
  12174. /\o{whatever}/
  12175. Failed: error 164 at offset 3: non-octal character in \o{} (closing brace missing?)
  12176. /\xthing/
  12177. /\x{}/
  12178. Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
  12179. /\x{whatever}/
  12180. Failed: error 167 at offset 3: non-hex character in \x{} (closing brace missing?)
  12181. /A\8B/
  12182. Failed: error 115 at offset 2: reference to non-existent subpattern
  12183. /A\9B/
  12184. Failed: error 115 at offset 2: reference to non-existent subpattern
  12185. # This one is here because Perl fails to match "12" for this pattern when the $
  12186. # is present.
  12187. /^(?(?=abc)\w{3}:|\d\d)$/
  12188. abc:
  12189. 0: abc:
  12190. 12
  12191. 0: 12
  12192. \= Expect no match
  12193. 123
  12194. No match
  12195. xyz
  12196. No match
  12197. # Perl gets this one wrong, giving "a" as the after text for ca and failing to
  12198. # match for cd.
  12199. /(?(?=ab)ab)/aftertext
  12200. abxxx
  12201. 0: ab
  12202. 0+ xxx
  12203. ca
  12204. 0:
  12205. 0+ ca
  12206. cd
  12207. 0:
  12208. 0+ cd
  12209. # This should test both paths for processing OP_RECURSE.
  12210. /(?(R)a+|(?R)b)/
  12211. aaaabcde
  12212. 0: aaaab
  12213. aaaabcde\=ovector=100
  12214. 0: aaaab
  12215. /a*?b*?/
  12216. ab
  12217. 0:
  12218. /(*NOTEMPTY)a*?b*?/
  12219. ab
  12220. 0: a
  12221. ba
  12222. 0: b
  12223. cb
  12224. 0: b
  12225. /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
  12226. ab
  12227. 0: a
  12228. 0+ b
  12229. cdab
  12230. 0:
  12231. 0+ dab
  12232. /(?(VERSION>=10.0)yes|no)/I
  12233. Capture group count = 0
  12234. Subject length lower bound = 2
  12235. yesno
  12236. 0: yes
  12237. /(?(VERSION>=10.04)yes|no)/
  12238. yesno
  12239. 0: yes
  12240. /(?(VERSION=8)yes){3}/BI,aftertext
  12241. ------------------------------------------------------------------
  12242. Bra
  12243. Cond
  12244. Cond false
  12245. yes
  12246. Ket
  12247. Ket
  12248. End
  12249. ------------------------------------------------------------------
  12250. Capture group count = 0
  12251. May match empty string
  12252. Subject length lower bound = 0
  12253. yesno
  12254. 0:
  12255. 0+ yesno
  12256. /(?(VERSION=8)yes|no){3}/I
  12257. Capture group count = 0
  12258. Subject length lower bound = 6
  12259. yesnononoyes
  12260. 0: nonono
  12261. \= Expect no match
  12262. yesno
  12263. No match
  12264. /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
  12265. Capture group count = 1
  12266. Max back reference = 1
  12267. Named capture groups:
  12268. VERSION 1
  12269. Starting code units: a x
  12270. Subject length lower bound = 5
  12271. abcyes
  12272. 0: abcyes
  12273. 1: abc
  12274. xyzno
  12275. 0: xyzno
  12276. \= Expect no match
  12277. abcno
  12278. No match
  12279. xyzyes
  12280. No match
  12281. /(?(VERSION<10)yes|no)/
  12282. Failed: error 179 at offset 10: syntax error or number too big in (?(VERSION condition
  12283. /(?(VERSION>10)yes|no)/
  12284. Failed: error 179 at offset 11: syntax error or number too big in (?(VERSION condition
  12285. /(?(VERSION>=10.0.0)yes|no)/
  12286. Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
  12287. /(?(VERSION=10.101)yes|no)/
  12288. Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
  12289. /abcd/I
  12290. Capture group count = 0
  12291. First code unit = 'a'
  12292. Last code unit = 'd'
  12293. Subject length lower bound = 4
  12294. /abcd/I,no_start_optimize
  12295. Capture group count = 0
  12296. Options: no_start_optimize
  12297. /(|ab)*?d/I
  12298. Capture group count = 1
  12299. Starting code units: a d
  12300. Last code unit = 'd'
  12301. Subject length lower bound = 1
  12302. abd
  12303. 0: abd
  12304. 1: ab
  12305. xyd
  12306. 0: d
  12307. /(|ab)*?d/I,no_start_optimize
  12308. Capture group count = 1
  12309. Options: no_start_optimize
  12310. abd
  12311. 0: abd
  12312. 1: ab
  12313. xyd
  12314. 0: d
  12315. /\k<A>*(?<A>aa)(?<A>bb)/match_unset_backref,dupnames
  12316. aabb
  12317. 0: aabb
  12318. 1: aa
  12319. 2: bb
  12320. /(((((a)))))/parens_nest_limit=2
  12321. Failed: error 119 at offset 3: parentheses are too deeply nested
  12322. /abc/replace=XYZ
  12323. 123123
  12324. 0: 123123
  12325. 123abc123
  12326. 1: 123XYZ123
  12327. 123abc123abc123
  12328. 1: 123XYZ123abc123
  12329. 123123\=zero_terminate
  12330. 0: 123123
  12331. 123abc123\=zero_terminate
  12332. 1: 123XYZ123
  12333. 123abc123abc123\=zero_terminate
  12334. 1: 123XYZ123abc123
  12335. /abc/g,replace=XYZ
  12336. 123abc123
  12337. 1: 123XYZ123
  12338. 123abc123abc123
  12339. 2: 123XYZ123XYZ123
  12340. /abc/replace=X$$Z
  12341. 123abc123
  12342. 1: 123X$Z123
  12343. /abc/g,replace=X$$Z
  12344. 123abc123abc123
  12345. 2: 123X$Z123X$Z123
  12346. /a(b)c(d)e/replace=X$1Y${2}Z
  12347. "abcde"
  12348. 1: "XbYdZ"
  12349. /a(b)c(d)e/replace=X$1Y${2}Z,global
  12350. "abcde-abcde"
  12351. 2: "XbYdZ-XbYdZ"
  12352. /a(?<ONE>b)c(?<TWO>d)e/replace=X$ONE+${TWO}Z
  12353. "abcde"
  12354. 1: "Xb+dZ"
  12355. /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z
  12356. "abcde-abcde-"
  12357. 2: "Xb+dZ-Xb+dZ-"
  12358. /abc/replace=a$++
  12359. 123abc
  12360. Failed: error -35 at offset 2 in replacement: invalid replacement string
  12361. /abc/replace=a$bad
  12362. 123abc
  12363. Failed: error -49 at offset 5 in replacement: unknown substring
  12364. /abc/replace=a${A234567890123456789_123456789012}z
  12365. 123abc
  12366. Failed: error -49 at offset 36 in replacement: unknown substring
  12367. /abc/replace=a${A23456789012345678901234567890123}z
  12368. 123abc
  12369. Failed: error -35 at offset 35 in replacement: invalid replacement string
  12370. /abc/replace=a${bcd
  12371. 123abc
  12372. Failed: error -58 at offset 6 in replacement: expected closing curly bracket in replacement string
  12373. /abc/replace=a${b+d}z
  12374. 123abc
  12375. Failed: error -58 at offset 4 in replacement: expected closing curly bracket in replacement string
  12376. /abc/replace=[10]XYZ
  12377. 123abc123
  12378. 1: 123XYZ123
  12379. /abc/replace=[9]XYZ
  12380. 123abc123
  12381. Failed: error -48: no more memory
  12382. /abc/replace=xyz
  12383. 1abc2\=partial_hard
  12384. Failed: error -34: bad option value
  12385. /abc/replace=xyz
  12386. 123abc456
  12387. 1: 123xyz456
  12388. 123abc456\=replace=pqr
  12389. 1: 123pqr456
  12390. 123abc456abc789
  12391. 1: 123xyz456abc789
  12392. 123abc456abc789\=g
  12393. 2: 123xyz456xyz789
  12394. /(?<=abc)(|def)/g,replace=<$0>
  12395. 123abcxyzabcdef789abcpqr
  12396. 4: 123abc<>xyzabc<><def>789abc<>pqr
  12397. /./replace=$0
  12398. a
  12399. 1: a
  12400. /(.)(.)/replace=$2+$1
  12401. abc
  12402. 1: b+ac
  12403. /(?<A>.)(?<B>.)/replace=$B+$A
  12404. abc
  12405. 1: b+ac
  12406. /(.)(.)/g,replace=$2$1
  12407. abcdefgh
  12408. 4: badcfehg
  12409. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
  12410. apple lemon blackberry
  12411. 3: pear orange strawberry
  12412. apple strudel
  12413. 1: pear strudel
  12414. fruitless
  12415. 0: fruitless
  12416. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
  12417. apple lemon blackberry
  12418. 1: pear sauce lemon blackberry
  12419. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
  12420. apple lemon blackberry
  12421. 3: <pear> <orange> <strawberry>
  12422. apple strudel
  12423. 1: <pear> strudel
  12424. fruitless
  12425. 0: fruitless
  12426. /(*:pear)apple/g,replace=${*MARKING}
  12427. apple lemon blackberry
  12428. Failed: error -35 at offset 11 in replacement: invalid replacement string
  12429. /(*:pear)apple/g,replace=${*MARK-time
  12430. apple lemon blackberry
  12431. Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
  12432. /(*:pear)apple/g,replace=${*mark}
  12433. apple lemon blackberry
  12434. Failed: error -35 at offset 8 in replacement: invalid replacement string
  12435. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
  12436. apple lemon blackberry
  12437. Failed: error -35 at offset 9 in replacement: invalid replacement string
  12438. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
  12439. apple lemon blackberry
  12440. Failed: error -48: no more memory
  12441. apple lemon blackberry\=substitute_overflow_length
  12442. Failed: error -48: no more memory: 23 code units are needed
  12443. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
  12444. apple lemon blackberry
  12445. 3: pear orange strawberry
  12446. /abc/
  12447. 123abc123\=replace=[9]XYZ
  12448. Failed: error -48: no more memory
  12449. 123abc123\=substitute_overflow_length,replace=[9]XYZ
  12450. Failed: error -48: no more memory: 10 code units are needed
  12451. 123abc123\=substitute_overflow_length,replace=[6]XYZ
  12452. Failed: error -48: no more memory: 10 code units are needed
  12453. 123abc123\=substitute_overflow_length,replace=[1]XYZ
  12454. Failed: error -48: no more memory: 10 code units are needed
  12455. 123abc123\=substitute_overflow_length,replace=[0]XYZ
  12456. Failed: error -48: no more memory: 10 code units are needed
  12457. /a(b)c/
  12458. 123abc123\=replace=[9]x$1z
  12459. Failed: error -48: no more memory
  12460. 123abc123\=substitute_overflow_length,replace=[9]x$1z
  12461. Failed: error -48: no more memory: 10 code units are needed
  12462. 123abc123\=substitute_overflow_length,replace=[6]x$1z
  12463. Failed: error -48: no more memory: 10 code units are needed
  12464. 123abc123\=substitute_overflow_length,replace=[1]x$1z
  12465. Failed: error -48: no more memory: 10 code units are needed
  12466. 123abc123\=substitute_overflow_length,replace=[0]x$1z
  12467. Failed: error -48: no more memory: 10 code units are needed
  12468. "((?=(?(?=(?(?=(?(?=()))))))))"
  12469. a
  12470. 0:
  12471. 1:
  12472. 2:
  12473. "(?(?=)==)(((((((((?=)))))))))"
  12474. \= Expect no match
  12475. a
  12476. No match
  12477. /(a)(b)|(c)/
  12478. XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
  12479. Matched, but too many substrings
  12480. 0: c
  12481. 1: <unset>
  12482. Get substring 1 failed (-55): requested value is not set
  12483. Get substring 2 failed (-54): requested value is not available
  12484. Get substring 3 failed (-54): requested value is not available
  12485. Get substring 4 failed (-49): unknown substring
  12486. 0L c
  12487. 1L
  12488. /x(?=ab\K)/allow_lookaround_bsk
  12489. xab\=get=0
  12490. Start of matched string is beyond its end - displaying from end to start.
  12491. 0: ab
  12492. 0G (0)
  12493. xab\=copy=0
  12494. Start of matched string is beyond its end - displaying from end to start.
  12495. 0: ab
  12496. 0C (0)
  12497. xab\=getall
  12498. Start of matched string is beyond its end - displaying from end to start.
  12499. 0: ab
  12500. 0L
  12501. /(?<A>a)|(?<A>b)/dupnames
  12502. a\=ovector=1,copy=A,get=A,get=2
  12503. Matched, but too many substrings
  12504. 0: a
  12505. Copy substring 'A' failed (-54): requested value is not available
  12506. Get substring 2 failed (-54): requested value is not available
  12507. Get substring 'A' failed (-54): requested value is not available
  12508. a\=ovector=2,copy=A,get=A,get=2
  12509. 0: a
  12510. 1: a
  12511. C a (1) A (non-unique)
  12512. Get substring 2 failed (-54): requested value is not available
  12513. G a (1) A (non-unique)
  12514. b\=ovector=2,copy=A,get=A,get=2
  12515. Matched, but too many substrings
  12516. 0: b
  12517. 1: <unset>
  12518. Copy substring 'A' failed (-55): requested value is not set
  12519. Get substring 2 failed (-54): requested value is not available
  12520. Get substring 'A' failed (-55): requested value is not set
  12521. /a(b)c(d)/
  12522. abc\=ph,copy=0,copy=1,getall
  12523. Partial match: abc
  12524. 0C abc (3)
  12525. Copy substring 1 failed (-2): partial match
  12526. get substring list failed (-2): partial match
  12527. /^abc/info
  12528. Capture group count = 0
  12529. Compile options: <none>
  12530. Overall options: anchored
  12531. First code unit = 'a'
  12532. Subject length lower bound = 3
  12533. /^abc/info,no_dotstar_anchor
  12534. Capture group count = 0
  12535. Compile options: no_dotstar_anchor
  12536. Overall options: anchored no_dotstar_anchor
  12537. First code unit = 'a'
  12538. Subject length lower bound = 3
  12539. /.*\d/info,auto_callout
  12540. Capture group count = 0
  12541. Options: auto_callout
  12542. First code unit at start or follows newline
  12543. Subject length lower bound = 1
  12544. \= Expect no match
  12545. aaa
  12546. --->aaa
  12547. +0 ^ .*
  12548. +2 ^ ^ \d
  12549. +2 ^ ^ \d
  12550. +2 ^^ \d
  12551. +2 ^ \d
  12552. No match
  12553. /.*\d/info,no_dotstar_anchor,auto_callout
  12554. Capture group count = 0
  12555. Options: auto_callout no_dotstar_anchor
  12556. Subject length lower bound = 1
  12557. \= Expect no match
  12558. aaa
  12559. --->aaa
  12560. +0 ^ .*
  12561. +2 ^ ^ \d
  12562. +2 ^ ^ \d
  12563. +2 ^^ \d
  12564. +2 ^ \d
  12565. +0 ^ .*
  12566. +2 ^ ^ \d
  12567. +2 ^^ \d
  12568. +2 ^ \d
  12569. +0 ^ .*
  12570. +2 ^^ \d
  12571. +2 ^ \d
  12572. No match
  12573. /.*\d/dotall,info
  12574. Capture group count = 0
  12575. Compile options: dotall
  12576. Overall options: anchored dotall
  12577. Subject length lower bound = 1
  12578. /.*\d/dotall,no_dotstar_anchor,info
  12579. Capture group count = 0
  12580. Options: dotall no_dotstar_anchor
  12581. Subject length lower bound = 1
  12582. /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
  12583. Capture group count = 0
  12584. Compile options: <none>
  12585. Overall options: no_dotstar_anchor
  12586. Subject length lower bound = 1
  12587. '^(?:(a)|b)(?(1)A|B)'
  12588. aA123\=ovector=1
  12589. Matched, but too many substrings
  12590. 0: aA
  12591. aA123\=ovector=2
  12592. 0: aA
  12593. 1: a
  12594. '^(?:(?<AA>a)|b)(?(<AA>)A|B)'
  12595. aA123\=ovector=1
  12596. Matched, but too many substrings
  12597. 0: aA
  12598. aA123\=ovector=2
  12599. 0: aA
  12600. 1: a
  12601. '^(?<AA>)(?:(?<AA>a)|b)(?(<AA>)A|B)'dupnames
  12602. aA123\=ovector=1
  12603. Matched, but too many substrings
  12604. 0: aA
  12605. aA123\=ovector=2
  12606. Matched, but too many substrings
  12607. 0: aA
  12608. 1:
  12609. aA123\=ovector=3
  12610. 0: aA
  12611. 1:
  12612. 2: a
  12613. '^(?:(?<AA>X)|)(?:(?<AA>a)|b)\k{AA}'dupnames
  12614. aa123\=ovector=1
  12615. Matched, but too many substrings
  12616. 0: aa
  12617. aa123\=ovector=2
  12618. Matched, but too many substrings
  12619. 0: aa
  12620. 1: <unset>
  12621. aa123\=ovector=3
  12622. 0: aa
  12623. 1: <unset>
  12624. 2: a
  12625. /(?<N111>(?J)(?<N111>1(111111)11|)1|1|)(?(<N111>)1)/
  12626. /(?<N>(?J)(?<N>))(?-J)\k<N>/
  12627. # Quantifiers are not allowed on condition assertions, but are otherwise
  12628. # OK in conditions.
  12629. /(?(?=0)?)+/
  12630. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  12631. /(?(?=0)(?=00)?00765)/
  12632. 00765
  12633. 0: 00765
  12634. /(?(?=0)(?=00)?00765|(?!3).56)/
  12635. 00765
  12636. 0: 00765
  12637. 456
  12638. 0: 456
  12639. \= Expect no match
  12640. 356
  12641. No match
  12642. '^(a)*+(\w)'
  12643. g
  12644. 0: g
  12645. 1: <unset>
  12646. 2: g
  12647. g\=ovector=1
  12648. Matched, but too many substrings
  12649. 0: g
  12650. '^(?:a)*+(\w)'
  12651. g
  12652. 0: g
  12653. 1: g
  12654. g\=ovector=1
  12655. Matched, but too many substrings
  12656. 0: g
  12657. # These two pattern showeds up compile-time bugs
  12658. "((?2){0,1999}())?"
  12659. /((?+1)(\1))/B
  12660. ------------------------------------------------------------------
  12661. Bra
  12662. CBra 1
  12663. Recurse
  12664. CBra 2
  12665. \1
  12666. Ket
  12667. Ket
  12668. Ket
  12669. End
  12670. ------------------------------------------------------------------
  12671. # Callouts with string arguments
  12672. /a(?C"/
  12673. Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
  12674. /a(?C"a/
  12675. Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
  12676. /a(?C"a"/
  12677. Failed: error 139 at offset 7: closing parenthesis for (?C expected
  12678. /a(?C"a"bcde(?C"b")xyz/
  12679. Failed: error 139 at offset 7: closing parenthesis for (?C expected
  12680. /a(?C"a)b""c")/B
  12681. ------------------------------------------------------------------
  12682. Bra
  12683. a
  12684. CalloutStr "a)b"c" 5 13 0
  12685. Ket
  12686. End
  12687. ------------------------------------------------------------------
  12688. /ab(?C" any text with spaces ")cde/B
  12689. ------------------------------------------------------------------
  12690. Bra
  12691. ab
  12692. CalloutStr " any text with spaces " 6 30 1
  12693. cde
  12694. Ket
  12695. End
  12696. ------------------------------------------------------------------
  12697. abcde
  12698. Callout (6): " any text with spaces "
  12699. --->abcde
  12700. ^ ^ c
  12701. 0: abcde
  12702. 12abcde
  12703. Callout (6): " any text with spaces "
  12704. --->12abcde
  12705. ^ ^ c
  12706. 0: abcde
  12707. /^a(b)c(?C1)def/
  12708. abcdef
  12709. --->abcdef
  12710. 1 ^ ^ d
  12711. 0: abcdef
  12712. 1: b
  12713. /^a(b)c(?C"AB")def/
  12714. abcdef
  12715. Callout (10): "AB"
  12716. --->abcdef
  12717. ^ ^ d
  12718. 0: abcdef
  12719. 1: b
  12720. /^a(b)c(?C1)def/
  12721. abcdef\=callout_capture
  12722. Callout 1: last capture = 1
  12723. 1: b
  12724. --->abcdef
  12725. ^ ^ d
  12726. 0: abcdef
  12727. 1: b
  12728. /^a(b)c(?C{AB})def/B
  12729. ------------------------------------------------------------------
  12730. Bra
  12731. ^
  12732. a
  12733. CBra 1
  12734. b
  12735. Ket
  12736. c
  12737. CalloutStr {AB} 10 14 1
  12738. def
  12739. Ket
  12740. End
  12741. ------------------------------------------------------------------
  12742. abcdef\=callout_capture
  12743. Callout (10): {AB} last capture = 1
  12744. 1: b
  12745. --->abcdef
  12746. ^ ^ d
  12747. 0: abcdef
  12748. 1: b
  12749. /(?C`a``b`)(?C'a''b')(?C"a""b")(?C^a^^b^)(?C%a%%b%)(?C#a##b#)(?C$a$$b$)(?C{a}}b})/B,callout_info
  12750. ------------------------------------------------------------------
  12751. Bra
  12752. CalloutStr `a`b` 4 10 0
  12753. CalloutStr 'a'b' 14 20 0
  12754. CalloutStr "a"b" 24 30 0
  12755. CalloutStr ^a^b^ 34 40 0
  12756. CalloutStr %a%b% 44 50 0
  12757. CalloutStr #a#b# 54 60 0
  12758. CalloutStr $a$b$ 64 70 0
  12759. CalloutStr {a}b} 74 80 0
  12760. Ket
  12761. End
  12762. ------------------------------------------------------------------
  12763. Callout `a`b` (
  12764. Callout 'a'b' (
  12765. Callout "a"b" (
  12766. Callout ^a^b^ (
  12767. Callout %a%b% (
  12768. Callout #a#b# (
  12769. Callout $a$b$ (
  12770. Callout {a}b}
  12771. /(?:a(?C`code`)){3}/B
  12772. ------------------------------------------------------------------
  12773. Bra
  12774. Bra
  12775. a
  12776. CalloutStr `code` 8 14 4
  12777. Ket
  12778. Bra
  12779. a
  12780. CalloutStr `code` 8 14 4
  12781. Ket
  12782. Bra
  12783. a
  12784. CalloutStr `code` 8 14 4
  12785. Ket
  12786. Ket
  12787. End
  12788. ------------------------------------------------------------------
  12789. /^(?(?C25)(?=abc)abcd|xyz)/B,callout_info
  12790. ------------------------------------------------------------------
  12791. Bra
  12792. ^
  12793. Cond
  12794. Callout 25 9 3
  12795. Assert
  12796. abc
  12797. Ket
  12798. abcd
  12799. Alt
  12800. xyz
  12801. Ket
  12802. Ket
  12803. End
  12804. ------------------------------------------------------------------
  12805. Callout 25 (?=
  12806. abcdefg
  12807. --->abcdefg
  12808. 25 ^ (?=
  12809. 0: abcd
  12810. xyz123
  12811. --->xyz123
  12812. 25 ^ (?=
  12813. 0: xyz
  12814. /^(?(?C$abc$)(?=abc)abcd|xyz)/B
  12815. ------------------------------------------------------------------
  12816. Bra
  12817. ^
  12818. Cond
  12819. CalloutStr $abc$ 7 12 3
  12820. Assert
  12821. abc
  12822. Ket
  12823. abcd
  12824. Alt
  12825. xyz
  12826. Ket
  12827. Ket
  12828. End
  12829. ------------------------------------------------------------------
  12830. abcdefg
  12831. Callout (7): $abc$
  12832. --->abcdefg
  12833. ^ (?=
  12834. 0: abcd
  12835. xyz123
  12836. Callout (7): $abc$
  12837. --->xyz123
  12838. ^ (?=
  12839. 0: xyz
  12840. /^ab(?C'first')cd(?C"second")ef/
  12841. abcdefg
  12842. Callout (7): 'first'
  12843. --->abcdefg
  12844. ^ ^ c
  12845. Callout (20): "second"
  12846. --->abcdefg
  12847. ^ ^ e
  12848. 0: abcdef
  12849. /(?:a(?C`code`)){3}X/
  12850. aaaXY
  12851. Callout (8): `code`
  12852. --->aaaXY
  12853. ^^ ){3}
  12854. Callout (8): `code`
  12855. --->aaaXY
  12856. ^ ^ ){3}
  12857. Callout (8): `code`
  12858. --->aaaXY
  12859. ^ ^ ){3}
  12860. 0: aaaX
  12861. # Binary zero in callout string
  12862. # a ( ? C ' x z ' ) b
  12863. / 61 28 3f 43 27 78 00 7a 27 29 62/hex,callout_info
  12864. Callout 'x\x00z' b
  12865. abcdefgh
  12866. Callout (5): 'x\x00z'
  12867. --->abcdefgh
  12868. ^^ b
  12869. 0: ab
  12870. /(?(?!)^)/
  12871. /(?(?!)a|b)/
  12872. bbb
  12873. 0: b
  12874. \= Expect no match
  12875. aaa
  12876. No match
  12877. # JIT gives a different error message for the infinite recursion
  12878. "(*NO_JIT)((?2)+)((?1)){"
  12879. abcd{
  12880. Failed: error -52: nested recursion at the same subject position
  12881. # Perl fails to diagnose the absence of an assertion
  12882. "(?(?<E>.*!.*)?)"
  12883. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  12884. "X((?2)()*+){2}+"B
  12885. ------------------------------------------------------------------
  12886. Bra
  12887. X
  12888. Once
  12889. CBra 1
  12890. Recurse
  12891. Braposzero
  12892. SCBraPos 2
  12893. KetRpos
  12894. Ket
  12895. CBra 1
  12896. Recurse
  12897. Braposzero
  12898. SCBraPos 2
  12899. KetRpos
  12900. Ket
  12901. Ket
  12902. Ket
  12903. End
  12904. ------------------------------------------------------------------
  12905. "X((?2)()*+){2}"B
  12906. ------------------------------------------------------------------
  12907. Bra
  12908. X
  12909. CBra 1
  12910. Recurse
  12911. Braposzero
  12912. SCBraPos 2
  12913. KetRpos
  12914. Ket
  12915. CBra 1
  12916. Recurse
  12917. Braposzero
  12918. SCBraPos 2
  12919. KetRpos
  12920. Ket
  12921. Ket
  12922. End
  12923. ------------------------------------------------------------------
  12924. /(?<=\bABQ(3(?-7)))/
  12925. Failed: error 115 at offset 15: reference to non-existent subpattern
  12926. /(?<=\bABQ(3(?+7)))/
  12927. Failed: error 115 at offset 15: reference to non-existent subpattern
  12928. ";(?<=()((?3))((?2)))"
  12929. Failed: error 125 at offset 1: length of lookbehind assertion is not limited
  12930. # Perl loops on this (PCRE2 used to!)
  12931. /(?<=\Ka)/g,aftertext,allow_lookaround_bsk
  12932. aaaaa
  12933. 0: a
  12934. 0+ aaaa
  12935. 0: a
  12936. 0+ aaa
  12937. 0: a
  12938. 0+ aa
  12939. 0: a
  12940. 0+ a
  12941. 0: a
  12942. 0+
  12943. /(?<=\Ka)/altglobal,aftertext,allow_lookaround_bsk
  12944. aaaaa
  12945. 0: a
  12946. 0+ aaaa
  12947. 0: a
  12948. 0+ aaa
  12949. 0: a
  12950. 0+ aa
  12951. 0: a
  12952. 0+ a
  12953. 0: a
  12954. 0+
  12955. /((?2){73}(?2))((?1))/info
  12956. Capture group count = 2
  12957. May match empty string
  12958. Subject length lower bound = 0
  12959. /abc/
  12960. \= Expect no match
  12961. \[9x!xxx(]{9999}
  12962. No match
  12963. /(abc)*/
  12964. \[abc]{5}
  12965. 0: abcabcabcabcabc
  12966. 1: abc
  12967. /^/gm
  12968. \n\n\n
  12969. 0:
  12970. 0:
  12971. 0:
  12972. /^/gm,alt_circumflex
  12973. \n\n\n
  12974. 0:
  12975. 0:
  12976. 0:
  12977. 0:
  12978. /((((((((x))))))))\81/
  12979. Failed: error 115 at offset 19: reference to non-existent subpattern
  12980. xx1
  12981. /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\80/
  12982. xx
  12983. Matched, but too many substrings
  12984. 0: xx
  12985. 1: x
  12986. 2: x
  12987. 3: x
  12988. 4: x
  12989. 5: x
  12990. 6: x
  12991. 7: x
  12992. 8: x
  12993. 9: x
  12994. 10: x
  12995. 11: x
  12996. 12: x
  12997. 13: x
  12998. 14: x
  12999. /\80/
  13000. Failed: error 115 at offset 2: reference to non-existent subpattern
  13001. /A\8B\9C/
  13002. Failed: error 115 at offset 2: reference to non-existent subpattern
  13003. A8B9C
  13004. /(?x:((?'a')) # comment (with parentheses) and | vertical
  13005. (?-x:#not a comment (?'b')) # this is a comment ()
  13006. (?'c')) # not a comment (?'d')/info
  13007. Capture group count = 5
  13008. Named capture groups:
  13009. a 2
  13010. b 3
  13011. c 4
  13012. d 5
  13013. First code unit = '#'
  13014. Last code unit = ' '
  13015. Subject length lower bound = 32
  13016. /(?|(?'a')(2)(?'b')|(?'a')(?'a')(3))/I,dupnames
  13017. Capture group count = 3
  13018. Named capture groups:
  13019. a 1
  13020. a 2
  13021. b 3
  13022. Options: dupnames
  13023. Starting code units: 2 3
  13024. Subject length lower bound = 1
  13025. A23B
  13026. 0: 2
  13027. 1:
  13028. 2: 2
  13029. 3:
  13030. B32A
  13031. 0: 3
  13032. 1:
  13033. 2:
  13034. 3: 3
  13035. # These are some patterns that used to cause buffer overflows or other errors
  13036. # while compiling.
  13037. /.((?2)(?R)|\1|$)()/B
  13038. ------------------------------------------------------------------
  13039. Bra
  13040. Any
  13041. CBra 1
  13042. Recurse
  13043. Recurse
  13044. Alt
  13045. \1
  13046. Alt
  13047. $
  13048. Ket
  13049. CBra 2
  13050. Ket
  13051. Ket
  13052. End
  13053. ------------------------------------------------------------------
  13054. /.((?3)(?R)()(?2)|\1|$)()/B
  13055. ------------------------------------------------------------------
  13056. Bra
  13057. Any
  13058. CBra 1
  13059. Recurse
  13060. Recurse
  13061. CBra 2
  13062. Ket
  13063. Recurse
  13064. Alt
  13065. \1
  13066. Alt
  13067. $
  13068. Ket
  13069. CBra 3
  13070. Ket
  13071. Ket
  13072. End
  13073. ------------------------------------------------------------------
  13074. /(\9*+(?2);\3++()2|)++{/
  13075. Failed: error 115 at offset 2: reference to non-existent subpattern
  13076. /\V\x85\9*+((?2)\3++()2)*:2/
  13077. Failed: error 115 at offset 7: reference to non-existent subpattern
  13078. /(((?(R)){0,2}) (?'x'((?'R')((?'R')))))/dupnames
  13079. /(((?(X)){0,2}) (?'x'((?'X')((?'X')))))/dupnames
  13080. /(((?(R)){0,2}) (?'x'((?'X')((?'R')))))/
  13081. "(?J)(?'d'(?'d'\g{d}))"
  13082. "(?=!((?2)(?))({8(?<=(?1){29}8bbbb\x16\xd\xc6^($(\xa9H4){4}h}?1)B))\x15')"
  13083. Failed: error 125 at offset 16: length of lookbehind assertion is not limited
  13084. /A(?'')Z/
  13085. Failed: error 162 at offset 4: subpattern name expected
  13086. "(?J:(?|(?'R')(\k'R')|((?'R'))))"
  13087. /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
  13088. Failed: error 161 at offset 17: subpattern number is too big
  13089. /^(?:(?(1)x|)+)+$()/B
  13090. ------------------------------------------------------------------
  13091. Bra
  13092. ^
  13093. SBra
  13094. SCond
  13095. 1 Cond ref
  13096. x
  13097. Alt
  13098. KetRmax
  13099. KetRmax
  13100. $
  13101. CBra 1
  13102. Ket
  13103. Ket
  13104. End
  13105. ------------------------------------------------------------------
  13106. /[[:>:]](?<)/
  13107. Failed: error 162 at offset 10: subpattern name expected
  13108. /((?x)(*:0))#(?'/
  13109. Failed: error 162 at offset 15: subpattern name expected
  13110. /(?C$[$)(?<]/
  13111. Failed: error 162 at offset 10: subpattern name expected
  13112. /(?C$)$)(?<]/
  13113. Failed: error 162 at offset 10: subpattern name expected
  13114. /(?(R))*+/B
  13115. ------------------------------------------------------------------
  13116. Bra
  13117. Braposzero
  13118. SBraPos
  13119. SCond
  13120. Cond recurse any
  13121. Ket
  13122. KetRpos
  13123. Ket
  13124. End
  13125. ------------------------------------------------------------------
  13126. abcd
  13127. 0:
  13128. /((?x)(?#))#(?'/
  13129. Failed: error 162 at offset 14: subpattern name expected
  13130. /((?x)(?#))#(?'abc')/I
  13131. Capture group count = 2
  13132. Named capture groups:
  13133. abc 2
  13134. First code unit = '#'
  13135. Subject length lower bound = 1
  13136. /[[:\\](?<[::]/
  13137. Failed: error 162 at offset 9: subpattern name expected
  13138. /[[:\\](?'abc')[a:]/I
  13139. Capture group count = 1
  13140. Named capture groups:
  13141. abc 1
  13142. Starting code units: : [ \
  13143. Subject length lower bound = 2
  13144. "[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
  13145. Failed: error 106 at offset 353: missing terminating ] for character class
  13146. /()(?(R)0)*+/B
  13147. ------------------------------------------------------------------
  13148. Bra
  13149. CBra 1
  13150. Ket
  13151. Braposzero
  13152. SBraPos
  13153. SCond
  13154. Cond recurse any
  13155. 0
  13156. Ket
  13157. KetRpos
  13158. Ket
  13159. End
  13160. ------------------------------------------------------------------
  13161. /(?R-:(?</
  13162. Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
  13163. /(?R-:(?<)/
  13164. Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
  13165. /(?(?C{\Q})(?!(?'/
  13166. Failed: error 162 at offset 16: subpattern name expected
  13167. /(?(?C{\Q})(?!(?'abc')))/I
  13168. Capture group count = 1
  13169. Named capture groups:
  13170. abc 1
  13171. May match empty string
  13172. Subject length lower bound = 0
  13173. /(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
  13174. Capture group count = 8
  13175. Max back reference = 8
  13176. Named capture groups:
  13177. R 7
  13178. R 8
  13179. Duplicate name status changes
  13180. Last code unit = '0'
  13181. Subject length lower bound = 65535
  13182. /(?|(aaa)|(b))\g{1}/I
  13183. Capture group count = 1
  13184. Max back reference = 1
  13185. Starting code units: a b
  13186. Subject length lower bound = 1
  13187. /(?|(aaa)|(b))(?1)/I
  13188. Capture group count = 1
  13189. Starting code units: a b
  13190. Subject length lower bound = 4
  13191. /(?|(aaa)|(b))/I
  13192. Capture group count = 1
  13193. Starting code units: a b
  13194. Subject length lower bound = 1
  13195. /(?|(?'a'aaa)|(?'a'b))\k'a'/I
  13196. Capture group count = 1
  13197. Max back reference = 1
  13198. Named capture groups:
  13199. a 1
  13200. Starting code units: a b
  13201. Subject length lower bound = 1
  13202. /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
  13203. Capture group count = 2
  13204. Max back reference = 2
  13205. Named capture groups:
  13206. a 1
  13207. a 2
  13208. Options: dupnames
  13209. Starting code units: a b
  13210. Last code unit = 'c'
  13211. Subject length lower bound = 5
  13212. /ab{3cd/
  13213. ab{3cd
  13214. 0: ab{3cd
  13215. /ab{3,cd/
  13216. ab{3,cd
  13217. 0: ab{3,cd
  13218. /ab{3,4a}cd/
  13219. ab{3,4a}cd
  13220. 0: ab{3,4a}cd
  13221. /{4,5a}bc/
  13222. {4,5a}bc
  13223. 0: {4,5a}bc
  13224. /\x0{ab}/
  13225. \0{ab}
  13226. 0: \x00{ab}
  13227. /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
  13228. ababababbbabZXXXX
  13229. 0: ababababbbabZ
  13230. 1: ab
  13231. 2: b
  13232. /.*?a(*PRUNE)b/
  13233. aab
  13234. 0: ab
  13235. /.*?a(*PRUNE)b/s
  13236. aab
  13237. 0: ab
  13238. /^a(*PRUNE)b/s
  13239. \= Expect no match
  13240. aab
  13241. No match
  13242. /.*?a(*SKIP)b/
  13243. aab
  13244. 0: ab
  13245. /(?(8000000000/
  13246. Failed: error 161 at offset 8: subpattern number is too big
  13247. /((?(R8000000000)))/
  13248. Failed: error 161 at offset 9: subpattern number is too big
  13249. /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
  13250. \= Expect no match
  13251. 01
  13252. No match
  13253. /(?(1)()\983040\2)/
  13254. Failed: error 161 at offset 14: subpattern number is too big
  13255. /(*LIMIT_MATCH=)abc/
  13256. Failed: error 160 at offset 14: (*VERB) not recognized or malformed
  13257. /(*CRLF)(*LIMIT_MATCH=)abc/
  13258. Failed: error 160 at offset 21: (*VERB) not recognized or malformed
  13259. /(?:ab)?(?:ab)(?:ab)/
  13260. abab
  13261. 0: abab
  13262. ababab
  13263. 0: ababab
  13264. \= Expect no match
  13265. aba
  13266. No match
  13267. /((*MARK:A))++a(*SKIP:B)b/
  13268. \= Expect no match
  13269. aacb
  13270. No match
  13271. /(*MARK:a\zb)z/alt_verbnames
  13272. Failed: error 140 at offset 10: invalid escape sequence in (*VERB) name
  13273. /(*:ab\t(d\)c)xxx/
  13274. Failed: error 122 at offset 12: unmatched closing parenthesis
  13275. /(*:ab\t(d\)c)xxx/alt_verbnames,mark
  13276. cxxxz
  13277. 0: xxx
  13278. MK: ab\x09(d)c
  13279. /(*:A\Qxx)x\EB)x/alt_verbnames,mark
  13280. x
  13281. 0: x
  13282. MK: Axx)xB
  13283. /(*:A\ExxxB)x/alt_verbnames,mark
  13284. x
  13285. 0: x
  13286. MK: AxxxB
  13287. /(*: A \ and #comment
  13288. \ B)x/x,alt_verbnames,mark
  13289. x
  13290. 0: x
  13291. MK: A and B
  13292. /(*: A \ and #comment
  13293. \ B)x/alt_verbnames,mark
  13294. x
  13295. 0: x
  13296. MK: A and #comment\x0a B
  13297. /(*: A \ and #comment
  13298. \ B)x/x,mark
  13299. x
  13300. 0: x
  13301. MK: A \ and #comment\x0a \ B
  13302. /(*: A \ and #comment
  13303. \ B)x/mark
  13304. x
  13305. 0: x
  13306. MK: A \ and #comment\x0a \ B
  13307. /(*:A
  13308. B)x/alt_verbnames,mark
  13309. x
  13310. 0: x
  13311. MK: A\x0aB
  13312. /(*:abc\Qpqr)/alt_verbnames
  13313. Failed: error 160 at offset 12: (*VERB) not recognized or malformed
  13314. /abc/use_offset_limit
  13315. 1234abcde\=offset_limit=100
  13316. 0: abc
  13317. 1234abcde\=offset_limit=9
  13318. 0: abc
  13319. 1234abcde\=offset_limit=4
  13320. 0: abc
  13321. 1234abcde\=offset_limit=4,offset=4
  13322. 0: abc
  13323. \= Expect no match
  13324. 1234abcde\=offset_limit=4,offset=5
  13325. No match
  13326. 1234abcde\=offset_limit=3
  13327. No match
  13328. /(?<=abc)/use_offset_limit
  13329. 1234abc\=offset_limit=7
  13330. 0:
  13331. \= Expect no match
  13332. 1234abc\=offset_limit=6
  13333. No match
  13334. /A/g,replace=-,use_offset_limit
  13335. XAXAXAXAXA\=offset_limit=4
  13336. 2: X-X-XAXAXA
  13337. /abc/
  13338. \= Expect error
  13339. 1234abcde\=offset_limit=4
  13340. Failed: error -56: offset limit set without PCRE2_USE_OFFSET_LIMIT
  13341. /^\w/m,use_offset_limit
  13342. \n..\naa\=offset_limit=3
  13343. No match
  13344. \n..\naa\=offset_limit=4
  13345. 0: a
  13346. /abcd/null_context
  13347. abcd\=null_context
  13348. 0: abcd
  13349. \= Expect error - not allowed together
  13350. abcd\=null_context,find_limits
  13351. ** Not allowed together: find_limits null_context
  13352. abcd\=allusedtext,startchar
  13353. ** Not allowed together: allusedtext startchar
  13354. /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
  13355. abcd
  13356. 1: w\x0dx\x82y\xdbz(12\$34$$\x345$)
  13357. /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended,substitute_literal
  13358. >>abcd<<
  13359. 1: >>w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$)<<
  13360. /abcd/g,replace=\$1$2\,substitute_literal
  13361. XabcdYabcdZ
  13362. 2: X\$1$2\Y\$1$2\Z
  13363. /a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
  13364. abcDE
  13365. 1: aBcBCbcdEdeabAByzDone
  13366. /abcd/replace=xy\kz,substitute_extended
  13367. abcd
  13368. Failed: error -57 at offset 4 in replacement: bad escape sequence in replacement string
  13369. /a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
  13370. ab
  13371. 1: X1X-2
  13372. ac
  13373. 1: X-1X2
  13374. ab\=replace=${1:+$1\:$1:$2}
  13375. 1: b:b
  13376. ac\=replace=${1:+$1\:$1:$2}
  13377. 1: c
  13378. >>ac<<\=replace=${1:+$1\:$1:$2},substitute_literal
  13379. 1: >>${1:+$1\:$1:$2}<<
  13380. /a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
  13381. ab
  13382. 1: XbX2:-2
  13383. ac
  13384. 1: X1:-1Xc
  13385. /(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
  13386. a
  13387. 1: >$1:{}$$+A<
  13388. /X(b)Y/substitute_extended
  13389. XbY\=replace=x${1:+$1\U$1}y
  13390. 1: xbBY
  13391. XbY\=replace=\Ux${1:+$1$1}y
  13392. 1: XBBY
  13393. /a/substitute_extended,replace=${*MARK:+a:b}
  13394. a
  13395. Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
  13396. /(abcd)/replace=${1:+xy\kz},substitute_extended
  13397. abcd
  13398. Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
  13399. /(abcd)/
  13400. abcd\=replace=${1:+xy\kz},substitute_extended
  13401. Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
  13402. /abcd/substitute_extended,replace=>$1<
  13403. abcd
  13404. Failed: error -49 at offset 3 in replacement: unknown substring
  13405. /abcd/substitute_extended,replace=>xxx${xyz}<<<
  13406. abcd
  13407. Failed: error -49 at offset 10 in replacement: unknown substring
  13408. /(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
  13409. [a]
  13410. 1: [<a>]
  13411. [b]
  13412. 1: [<b>]
  13413. \= Expect error
  13414. (a)\=ovector=1
  13415. Failed: error -54 at offset 3 in replacement: requested value is not available
  13416. /(a)|(b)/replace=<$1>
  13417. \= Expect error
  13418. b
  13419. Failed: error -55 at offset 3 in replacement: requested value is not set
  13420. /(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
  13421. aaBB
  13422. 1: AAbbaa..AAbBaa
  13423. /abcd/replace=wxyz,substitute_matched
  13424. abcd
  13425. 1: wxyz
  13426. pqrs
  13427. 0: pqrs
  13428. /abcd/g
  13429. >abcd1234abcd5678<\=replace=wxyz,substitute_matched
  13430. 2: >wxyz1234wxyz5678<
  13431. /^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
  13432. Capture group count = 2
  13433. Max back reference = 1
  13434. Compile options: <none>
  13435. Overall options: anchored
  13436. First code unit = 'o'
  13437. Last code unit = '}'
  13438. Subject length lower bound = 65535
  13439. /((p(?'K/
  13440. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  13441. /((p(?'K/no_auto_capture
  13442. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  13443. /abc/replace=A$3123456789Z
  13444. abc
  13445. Failed: error -49 at offset 3 in replacement: unknown substring
  13446. /(?<!a{65535}a{5})x/I
  13447. Failed: error 187 at offset 0: lookbehind assertion is too long
  13448. /(?<!a{65535})x/I
  13449. Capture group count = 0
  13450. Max lookbehind = 65535
  13451. First code unit = 'x'
  13452. Subject length lower bound = 1
  13453. /(?=a\K)/replace=z,allow_lookaround_bsk
  13454. BaCaD
  13455. Failed: error -60: match with end before start or start moved backwards is not supported
  13456. /(?<=\K.)/g,replace=-,allow_lookaround_bsk
  13457. ab
  13458. Failed: error -60: match with end before start or start moved backwards is not supported
  13459. /(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFGH'toolong)/
  13460. Failed: error 148 at offset 132: subpattern name is too long (maximum 128 code units)
  13461. /(?'abcdefghijklmnopqrstuvwxyzABCDEFGabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEabcdefghijklmnopqrstuvwxyzABCDEFG'justright)/
  13462. # These two use zero-termination
  13463. /abcd/max_pattern_length=3
  13464. Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
  13465. /abc/max_pattern_length=3
  13466. # These two, being hex, pass the length
  13467. /abcdefab/hex,max_pattern_length=3
  13468. Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
  13469. /abcdef/hex,max_pattern_length=3
  13470. # Test compiled length limit
  13471. /(abcdefg){10}/max_pattern_compiled_length=100
  13472. Failed: error 201 at offset 13: compiled pattern would be longer than the limit set by the application
  13473. # These patterns used to take a long time to compile
  13474. "(.*)
  13475. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13476. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13477. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
  13478. Capture group count = 12
  13479. May match empty string
  13480. Options: extended
  13481. First code unit at start or follows newline
  13482. Subject length lower bound = 0
  13483. "(?<=a()
  13484. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13485. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13486. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13487. a)"xI
  13488. Capture group count = 12
  13489. Max lookbehind = 2
  13490. May match empty string
  13491. Options: extended
  13492. Subject length lower bound = 0
  13493. "(?|()|())(.*)
  13494. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13495. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13496. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
  13497. Capture group count = 13
  13498. May match empty string
  13499. Options: extended
  13500. Subject length lower bound = 0
  13501. "(?|()|())(?<=a()
  13502. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13503. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13504. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13505. a)"xI
  13506. Failed: error 135 at offset 9: lookbehind is too complicated
  13507. # Test the use of malloc for caching group information when there are more
  13508. # groups than fit into the on-stack workspace.
  13509. /\[()]{1024}/I,expand
  13510. Expanded: ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
  13511. Capture group count = 1024
  13512. May match empty string
  13513. Subject length lower bound = 0
  13514. # Test minlength capped at 65535
  13515. /(A{65000})\1{65000}/I
  13516. Capture group count = 1
  13517. Max back reference = 1
  13518. First code unit = 'A'
  13519. Last code unit = 'A'
  13520. Subject length lower bound = 65535
  13521. # Test group scans when numbers are not unique
  13522. /(?|()+|(a)+)/BI
  13523. ------------------------------------------------------------------
  13524. Bra
  13525. Bra
  13526. SCBra 1
  13527. KetRmax
  13528. Alt
  13529. CBra 1
  13530. a
  13531. KetRmax
  13532. Ket
  13533. Ket
  13534. End
  13535. ------------------------------------------------------------------
  13536. Capture group count = 1
  13537. May match empty string
  13538. Subject length lower bound = 0
  13539. /(?|(a)+|()+)/BI
  13540. ------------------------------------------------------------------
  13541. Bra
  13542. Bra
  13543. CBra 1
  13544. a
  13545. KetRmax
  13546. Alt
  13547. SCBra 1
  13548. KetRmax
  13549. Ket
  13550. Ket
  13551. End
  13552. ------------------------------------------------------------------
  13553. Capture group count = 1
  13554. May match empty string
  13555. Subject length lower bound = 0
  13556. /(?|()|(a))/BI
  13557. ------------------------------------------------------------------
  13558. Bra
  13559. Bra
  13560. CBra 1
  13561. Ket
  13562. Alt
  13563. CBra 1
  13564. a
  13565. Ket
  13566. Ket
  13567. Ket
  13568. End
  13569. ------------------------------------------------------------------
  13570. Capture group count = 1
  13571. May match empty string
  13572. Subject length lower bound = 0
  13573. /(?|(a)|())/BI
  13574. ------------------------------------------------------------------
  13575. Bra
  13576. Bra
  13577. CBra 1
  13578. a
  13579. Ket
  13580. Alt
  13581. CBra 1
  13582. Ket
  13583. Ket
  13584. Ket
  13585. End
  13586. ------------------------------------------------------------------
  13587. Capture group count = 1
  13588. May match empty string
  13589. Subject length lower bound = 0
  13590. # Test CRLF handling in empty string substitutions
  13591. /^$/gm,newline=anycrlf,replace=-
  13592. X\r\n\r\nY
  13593. 1: X\x0d\x0a-\x0d\x0aY
  13594. /^$/gm,newline=crlf,replace=-
  13595. X\r\n\r\nY
  13596. 1: X\x0d\x0a-\x0d\x0aY
  13597. /^$/gm,newline=any,replace=-
  13598. X\r\n\r\nY
  13599. 1: X\x0d\x0a-\x0d\x0aY
  13600. "(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
  13601. 15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
  13602. 4: 15\x0d\x0aNaN\x0d\x0a20\x0d\x0aNaN\x0d\x0aNaN\x0d\x0aNaN\x0d\x0a20
  13603. /a[[:punct:]b]/bincode
  13604. ------------------------------------------------------------------
  13605. Bra
  13606. a
  13607. [!-/:-@[-`b{-~]
  13608. Ket
  13609. End
  13610. ------------------------------------------------------------------
  13611. /a[b[:punct:]]/bincode
  13612. ------------------------------------------------------------------
  13613. Bra
  13614. a
  13615. [!-/:-@[-`b{-~]
  13616. Ket
  13617. End
  13618. ------------------------------------------------------------------
  13619. /L(?#(|++<!(2)?/B
  13620. ------------------------------------------------------------------
  13621. Bra
  13622. L?+
  13623. Ket
  13624. End
  13625. ------------------------------------------------------------------
  13626. /L(?#(|++<!(2)?/B,no_auto_possess
  13627. ------------------------------------------------------------------
  13628. Bra
  13629. L?
  13630. Ket
  13631. End
  13632. ------------------------------------------------------------------
  13633. /L(?#(|++<!(2)?/B,auto_callout
  13634. ------------------------------------------------------------------
  13635. Bra
  13636. Callout 255 0 14
  13637. L?+
  13638. Callout 255 14 0
  13639. Ket
  13640. End
  13641. ------------------------------------------------------------------
  13642. /L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
  13643. ------------------------------------------------------------------
  13644. Bra
  13645. Callout 255 0 14
  13646. L?
  13647. Callout 255 14 0
  13648. Ket
  13649. End
  13650. ------------------------------------------------------------------
  13651. /(A*)\E+/B,auto_callout
  13652. ------------------------------------------------------------------
  13653. Bra
  13654. Callout 255 0 1
  13655. SCBra 1
  13656. Callout 255 1 2
  13657. A*
  13658. Callout 255 3 4
  13659. KetRmax
  13660. Callout 255 7 0
  13661. Ket
  13662. End
  13663. ------------------------------------------------------------------
  13664. /()\Q\E*]/B,auto_callout
  13665. ------------------------------------------------------------------
  13666. Bra
  13667. Callout 255 0 1
  13668. Brazero
  13669. SCBra 1
  13670. Callout 255 1 6
  13671. KetRmax
  13672. Callout 255 7 1
  13673. ]
  13674. Callout 255 8 0
  13675. Ket
  13676. End
  13677. ------------------------------------------------------------------
  13678. a[bc]d
  13679. --->a[bc]d
  13680. +0 ^ (
  13681. +1 ^ )\Q\E*
  13682. +7 ^ ]
  13683. +8 ^^ End of pattern
  13684. 0: ]
  13685. 1:
  13686. /\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
  13687. ------------------------------------------------------------------
  13688. Bra
  13689. \x{8a}++
  13690. f
  13691. Alt
  13692. ;
  13693. T?
  13694. *MARK ;.'?`(\x{ea}p
  13695. {!
  13696. [\x00- "-&+-:<->@-BD-xz-\xff] (neg)
  13697. {1;
  13698. CBra 1
  13699. \x08
  13700. Ket
  13701. Ket
  13702. End
  13703. ------------------------------------------------------------------
  13704. # Tests for NULL characters in comments and verb "names" and callouts
  13705. # /A#B\x00C\x0aZ/
  13706. /41 23 42 00 43 0a 5a/Bx,hex
  13707. ------------------------------------------------------------------
  13708. Bra
  13709. AZ
  13710. Ket
  13711. End
  13712. ------------------------------------------------------------------
  13713. # /A+#B\x00C\x0a+/
  13714. /41 2b 23 42 00 43 0a 2b/Bx,hex
  13715. ------------------------------------------------------------------
  13716. Bra
  13717. A++
  13718. Ket
  13719. End
  13720. ------------------------------------------------------------------
  13721. # /A(*:B\x00W#X\00Y\x0aC)Z/
  13722. /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
  13723. ------------------------------------------------------------------
  13724. Bra
  13725. A
  13726. *MARK B\x{0}WC
  13727. Z
  13728. Ket
  13729. End
  13730. ------------------------------------------------------------------
  13731. # /A(*:B\x00W#X\00Y\x0aC)Z/
  13732. /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
  13733. ------------------------------------------------------------------
  13734. Bra
  13735. A
  13736. *MARK B\x{0}W#X\x{0}Y\x{a}C
  13737. Z
  13738. Ket
  13739. End
  13740. ------------------------------------------------------------------
  13741. # /A(?C{X\x00Y})B/
  13742. /41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
  13743. ------------------------------------------------------------------
  13744. Bra
  13745. A
  13746. CalloutStr {X\x{0}Y} 5 10 1
  13747. B
  13748. Ket
  13749. End
  13750. ------------------------------------------------------------------
  13751. # /A(?#X\x00Y)B/
  13752. /41 28 3f 23 7b 00 7d 29 42/B,hex
  13753. ------------------------------------------------------------------
  13754. Bra
  13755. AB
  13756. Ket
  13757. End
  13758. ------------------------------------------------------------------
  13759. # Tests for leading comment in extended patterns
  13760. / (?-x):?/extended
  13761. / (?-x):?/extended
  13762. /0b 28 3f 2d 78 29 3a/hex,extended
  13763. /#comment
  13764. (?-x):?/extended
  13765. /(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
  13766. Failed: error 162 at offset 49: subpattern name expected
  13767. /a|(b)c/replace=>$1<,substitute_unset_empty
  13768. cat
  13769. 1: c><t
  13770. xbcom
  13771. 1: x>b<om
  13772. /a|(b)c/
  13773. cat\=replace=>$1<
  13774. Failed: error -55 at offset 3 in replacement: requested value is not set
  13775. cat\=replace=>$1<,substitute_unset_empty
  13776. 1: c><t
  13777. xbcom\=replace=>$1<,substitute_unset_empty
  13778. 1: x>b<om
  13779. /a|(b)c/substitute_extended
  13780. cat\=replace=>${2:-xx}<
  13781. Failed: error -49 at offset 9 in replacement: unknown substring
  13782. cat\=replace=>${2:-xx}<,substitute_unknown_unset
  13783. 1: c>xx<t
  13784. cat\=replace=>${X:-xx}<,substitute_unknown_unset
  13785. 1: c>xx<t
  13786. /a|(?'X'b)c/replace=>$X<,substitute_unset_empty
  13787. cat
  13788. 1: c><t
  13789. xbcom
  13790. 1: x>b<om
  13791. /a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
  13792. cat
  13793. Failed: error -49 at offset 3 in replacement: unknown substring
  13794. cat\=substitute_unknown_unset
  13795. 1: c><t
  13796. cat\=substitute_unknown_unset,-substitute_unset_empty
  13797. Failed: error -55 at offset 3 in replacement: requested value is not set
  13798. /a|(b)c/replace=>$2<,substitute_unset_empty
  13799. cat
  13800. Failed: error -49 at offset 3 in replacement: unknown substring
  13801. cat\=substitute_unknown_unset
  13802. 1: c><t
  13803. cat\=substitute_unknown_unset,-substitute_unset_empty
  13804. Failed: error -55 at offset 3 in replacement: requested value is not set
  13805. /()()()/use_offset_limit
  13806. \=ovector=11000000000
  13807. ** Invalid value in 'ovector=11000000000'
  13808. \=callout_fail=11000000000
  13809. ** Invalid value in 'callout_fail=11000000000'
  13810. \=callout_fail=1:11000000000
  13811. ** Invalid value in 'callout_fail=1:11000000000'
  13812. \=callout_data=11000000000
  13813. ** Invalid value in 'callout_data=11000000000'
  13814. \=callout_data=-11000000000
  13815. ** Invalid value in 'callout_data=-11000000000'
  13816. \=offset_limit=1100000000000000000000
  13817. ** Invalid value in 'offset_limit=1100000000000000000000'
  13818. \=copy=11000000000
  13819. ** Invalid value in 'copy=11000000000'
  13820. /(*MARK:A\x00b)/mark
  13821. abc
  13822. 0:
  13823. MK: A\x00b
  13824. /(*MARK:A\x00b)/mark,alt_verbnames
  13825. abc
  13826. 0:
  13827. MK: A\x00b
  13828. /"(*MARK:A" 00 "b)"/mark,hex
  13829. abc
  13830. 0:
  13831. MK: A\x00b
  13832. /"(*MARK:A" 00 "b)"/mark,hex,alt_verbnames
  13833. abc
  13834. 0:
  13835. MK: A\x00b
  13836. /efg/hex
  13837. ** Unexpected non-hex-digit 'g' at offset 2 in hex pattern: quote missing?
  13838. /eff/hex
  13839. ** Odd number of digits in hex pattern
  13840. /effg/hex
  13841. ** Unexpected non-hex-digit 'g' at offset 3 in hex pattern: quote missing?
  13842. /(?J)(?'a'))(?'a')/
  13843. Failed: error 122 at offset 10: unmatched closing parenthesis
  13844. /(?<=((?C)0))/
  13845. 9010
  13846. --->9010
  13847. 0 ^ 0
  13848. 0 ^ 0
  13849. 0:
  13850. 1: 0
  13851. \= Expect no match
  13852. abc
  13853. --->abc
  13854. 0 ^ 0
  13855. 0 ^ 0
  13856. 0 ^ 0
  13857. No match
  13858. /aaa/
  13859. \[abc]{10000000000000000000000000000}
  13860. ** Repeat count too large
  13861. \[a]{3}
  13862. 0: aaa
  13863. /\[AB]{6000000000000000000000}/expand
  13864. ** Pattern repeat count too large
  13865. # Hex uses pattern length, not zero-terminated. This tests for overrunning
  13866. # the given length of a pattern.
  13867. /'(*U'/hex
  13868. Failed: error 160 at offset 3: (*VERB) not recognized or malformed
  13869. /'(*'/hex
  13870. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  13871. /'('/hex
  13872. Failed: error 114 at offset 1: missing closing parenthesis
  13873. //hex
  13874. # These tests are here because Perl never allows a back reference in a
  13875. # lookbehind. PCRE2 supports some limited cases.
  13876. /([ab])...(?<=\1)z/
  13877. a11az
  13878. 0: a11az
  13879. 1: a
  13880. b11bz
  13881. 0: b11bz
  13882. 1: b
  13883. \= Expect no match
  13884. b11az
  13885. No match
  13886. /(?|([ab]))...(?<=\1)z/
  13887. Failed: error 125 at offset 13: length of lookbehind assertion is not limited
  13888. /([ab])(\1)...(?<=\2)z/
  13889. aa11az
  13890. 0: aa11az
  13891. 1: a
  13892. 2: a
  13893. /(a\2)(b\1)(?<=\2)/
  13894. Failed: error 125 at offset 10: length of lookbehind assertion is not limited
  13895. /(?<A>[ab])...(?<=\k'A')z/
  13896. a11az
  13897. 0: a11az
  13898. 1: a
  13899. b11bz
  13900. 0: b11bz
  13901. 1: b
  13902. \= Expect no match
  13903. b11az
  13904. No match
  13905. /(?<A>[ab])...(?<=\k'A')(?<A>)z/dupnames
  13906. Failed: error 125 at offset 13: length of lookbehind assertion is not limited
  13907. # Perl does not support \g+n
  13908. /((\g+1X)?([ab]))+/
  13909. aaXbbXa
  13910. 0: aaXbbXa
  13911. 1: bXa
  13912. 2: bX
  13913. 3: a
  13914. /ab(?C1)c/auto_callout
  13915. abc
  13916. --->abc
  13917. +0 ^ a
  13918. +1 ^^ b
  13919. 1 ^ ^ c
  13920. +8 ^ ^ End of pattern
  13921. 0: abc
  13922. /'ab(?C1)c'/hex,auto_callout
  13923. abc
  13924. --->abc
  13925. +0 ^ a
  13926. +1 ^^ b
  13927. 1 ^ ^ c
  13928. +8 ^ ^ End of pattern
  13929. 0: abc
  13930. # Perl accepts these, but gives a warning. We can't warn, so give an error.
  13931. /[a-[:digit:]]+/
  13932. Failed: error 150 at offset 4: invalid range in character class
  13933. a-a9-a
  13934. /[A-[:digit:]]+/
  13935. Failed: error 150 at offset 4: invalid range in character class
  13936. A-A9-A
  13937. /[a-\d]+/
  13938. Failed: error 150 at offset 5: invalid range in character class
  13939. a-a9-a
  13940. /(?<RA>abc)(?(R)xyz)/B
  13941. ------------------------------------------------------------------
  13942. Bra
  13943. CBra 1
  13944. abc
  13945. Ket
  13946. Cond
  13947. Cond recurse any
  13948. xyz
  13949. Ket
  13950. Ket
  13951. End
  13952. ------------------------------------------------------------------
  13953. /(?<R>abc)(?(R)xyz)/B
  13954. ------------------------------------------------------------------
  13955. Bra
  13956. CBra 1
  13957. abc
  13958. Ket
  13959. Cond
  13960. 1 Cond ref
  13961. xyz
  13962. Ket
  13963. Ket
  13964. End
  13965. ------------------------------------------------------------------
  13966. /(?=.*[A-Z])/I
  13967. Capture group count = 0
  13968. May match empty string
  13969. Subject length lower bound = 0
  13970. /()(?<=(?0))/
  13971. Failed: error 125 at offset 2: length of lookbehind assertion is not limited
  13972. /(?<!|!(?<!))/
  13973. /(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
  13974. /{2,2{2,2/use_length
  13975. /.>*?\g'0/use_length
  13976. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  13977. /.>*?\g'0/
  13978. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  13979. /{�̈́�̈́�{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ą̈́�̈́�{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout
  13980. //
  13981. \=get=i00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  13982. ** Group name in 'get' is too long
  13983. \=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
  13984. ** Too many characters in named 'get' modifiers
  13985. "(?(?C))"
  13986. Failed: error 128 at offset 6: assertion expected after (?( or (?(?C)
  13987. /(?(?(?(?(?(?))))))/
  13988. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  13989. /(?<=(?1))((?s))/anchored
  13990. /(*:ab)*/
  13991. Failed: error 109 at offset 6: quantifier does not follow a repeatable item
  13992. %(*:(:(svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
  13993. /./newline=crlf
  13994. \=ph
  13995. No match
  13996. /(\x0e00\000000\xc)/replace=\P,substitute_extended
  13997. \x0e00\000000\xc
  13998. Failed: error -57 at offset 2 in replacement: bad escape sequence in replacement string
  13999. //replace=0
  14000. \=offset=7
  14001. Failed: error -33: bad offset value
  14002. /(?<=\G.)/g,replace=+
  14003. abc
  14004. 3: a+b+c+
  14005. ".+\QX\E+"B,no_auto_possess
  14006. ------------------------------------------------------------------
  14007. Bra
  14008. Any+
  14009. X+
  14010. Ket
  14011. End
  14012. ------------------------------------------------------------------
  14013. ".+\QX\E+"B,auto_callout,no_auto_possess
  14014. ------------------------------------------------------------------
  14015. Bra
  14016. Callout 255 0 4
  14017. Any+
  14018. Callout 255 4 4
  14019. X+
  14020. Callout 255 8 0
  14021. Ket
  14022. End
  14023. ------------------------------------------------------------------
  14024. # This one is here because Perl gives an 'unmatched )' error which goes away
  14025. # if one of the \) sequences is removed - which is weird. PCRE finds it too
  14026. # complicated to find a minimum matching length.
  14027. "()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I
  14028. Capture group count = 108
  14029. Max back reference = 22
  14030. Contains explicit CR or LF match
  14031. Subject length lower bound = 1
  14032. # This checks that new code for handling groups that may match an empty string
  14033. # works on a very large number of alternatives. This pattern used to provoke a
  14034. # complaint that it was too complicated.
  14035. /(?:\[A|B|C|D|E|F|G|H|I|J|]{200}Z)/expand
  14036. # This one used to compile rubbish instead of a compile error, and then
  14037. # behave unpredictably at match time.
  14038. /.+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X/
  14039. Failed: error 128 at offset 63: assertion expected after (?( or (?(?C)
  14040. .+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X
  14041. /[:[:alnum:]-[[a:lnum:]+/
  14042. Failed: error 150 at offset 11: invalid range in character class
  14043. /((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
  14044. Failed: error 128 at offset 11: assertion expected after (?( or (?(?C)
  14045. /((?(?C'')\Q\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
  14046. /abcd/auto_callout
  14047. abcd\=callout_error=255:2
  14048. --->abcd
  14049. +0 ^ a
  14050. +1 ^^ b
  14051. Failed: error -37: callout error code
  14052. /()(\g+65534)/
  14053. Failed: error 161 at offset 11: subpattern number is too big
  14054. /()(\g+65533)/
  14055. Failed: error 115 at offset 10: reference to non-existent subpattern
  14056. /�\x00\x00\x00�(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00‎\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00��\x00�(\1{50779}?)J\w2/I
  14057. Capture group count = 2
  14058. Max back reference = 2
  14059. First code unit = \xc1
  14060. Last code unit = '2'
  14061. Subject length lower bound = 65535
  14062. /(a)(b)\2\1\1\1\1/I
  14063. Capture group count = 2
  14064. Max back reference = 2
  14065. First code unit = 'a'
  14066. Last code unit = 'b'
  14067. Subject length lower bound = 7
  14068. /(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames
  14069. Capture group count = 4
  14070. Max back reference = 4
  14071. Named capture groups:
  14072. a 1
  14073. a 3
  14074. b 2
  14075. b 4
  14076. Options: dupnames
  14077. First code unit = 'a'
  14078. Last code unit = 'z'
  14079. Subject length lower bound = 11
  14080. //
  14081. \=ovector=7777777777
  14082. ** Invalid value in 'ovector=7777777777'
  14083. # This is here because Perl matches, even though a COMMIT is encountered
  14084. # outside of the recursion.
  14085. /(?1)(A(*COMMIT)|B)D/
  14086. BAXBAD
  14087. No match
  14088. "(?1){2}(a)"B
  14089. ------------------------------------------------------------------
  14090. Bra
  14091. Recurse
  14092. Recurse
  14093. CBra 1
  14094. a
  14095. Ket
  14096. Ket
  14097. End
  14098. ------------------------------------------------------------------
  14099. "(?1){2,4}(a)"B
  14100. ------------------------------------------------------------------
  14101. Bra
  14102. Recurse
  14103. Recurse
  14104. Brazero
  14105. Bra
  14106. Bra
  14107. Recurse
  14108. Ket
  14109. Brazero
  14110. Bra
  14111. Recurse
  14112. Ket
  14113. Ket
  14114. CBra 1
  14115. a
  14116. Ket
  14117. Ket
  14118. End
  14119. ------------------------------------------------------------------
  14120. # This test differs from Perl for the first subject. Perl ends up with
  14121. # $1 set to 'B'; PCRE2 has it unset (which I think is right).
  14122. /^(?:
  14123. (?:A| (?:B|B(*ACCEPT)) (?<=(.)) D)
  14124. (Z)
  14125. )+$/x
  14126. AZB
  14127. 0: AZB
  14128. 1: <unset>
  14129. 2: Z
  14130. AZBDZ
  14131. 0: AZBDZ
  14132. 1: B
  14133. 2: Z
  14134. # The first of these, when run by Perl, gives the mark 'aa', which is wrong.
  14135. '(?>a(*:aa))b|ac' mark
  14136. ac
  14137. 0: ac
  14138. '(?:a(*:aa))b|ac' mark
  14139. ac
  14140. 0: ac
  14141. /(R?){65}/
  14142. (R?){65}
  14143. 0:
  14144. 1:
  14145. /\[(a)]{60}/expand
  14146. aaaa
  14147. No match
  14148. /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended
  14149. /\g{3/
  14150. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  14151. /(a(?C1)(b)(c)d)+/
  14152. abcdabcd\=callout_capture
  14153. Callout 1: last capture = 0
  14154. --->abcdabcd
  14155. ^^ (
  14156. Callout 1: last capture = 1
  14157. 1: abcd
  14158. 2: b
  14159. 3: c
  14160. --->abcdabcd
  14161. ^ ^ (
  14162. 0: abcdabcd
  14163. 1: abcd
  14164. 2: b
  14165. 3: c
  14166. # Perl matches this one, but PCRE does not because (*ACCEPT) clears out any
  14167. # pending backtracks in the recursion.
  14168. /^ (?(DEFINE) (..(*ACCEPT)|...) ) (?1)$/x
  14169. \= Expect no match
  14170. abc
  14171. No match
  14172. # Perl gives no match for this one
  14173. /(a(*MARK:m)(*ACCEPT)){0}(?1)/mark
  14174. abc
  14175. 0: a
  14176. MK: m
  14177. /abc/endanchored
  14178. xyzabc
  14179. 0: abc
  14180. \= Expect no match
  14181. xyzabcdef
  14182. No match
  14183. \= Expect error
  14184. xyzabc\=ph
  14185. Failed: error -34: bad option value
  14186. /abc/
  14187. xyzabc\=endanchored
  14188. 0: abc
  14189. \= Expect no match
  14190. xyzabcdef\=endanchored
  14191. No match
  14192. \= Expect error
  14193. xyzabc\=ps,endanchored
  14194. Failed: error -34: bad option value
  14195. /abc(*ACCEPT)d/endanchored
  14196. xyzabc
  14197. 0: abc
  14198. \= Expect no match
  14199. xyzabcdef
  14200. No match
  14201. /abc|bcd/endanchored
  14202. xyzabcd
  14203. 0: bcd
  14204. \= Expect no match
  14205. xyzabcdef
  14206. No match
  14207. /a(*ACCEPT)x|aa/endanchored
  14208. aaa
  14209. 0: a
  14210. # Check auto-anchoring when there is a group that is never obeyed at
  14211. # the start of a branch.
  14212. /(?(DEFINE)(a))^bc/I
  14213. Capture group count = 1
  14214. Compile options: <none>
  14215. Overall options: anchored
  14216. First code unit = 'b'
  14217. Subject length lower bound = 2
  14218. /(a){0}.*bc/sI
  14219. Capture group count = 1
  14220. Compile options: dotall
  14221. Overall options: anchored dotall
  14222. Last code unit = 'c'
  14223. Subject length lower bound = 2
  14224. # This should be anchored, as the condition is always false and there is
  14225. # no alternative branch.
  14226. /(?(VERSION>=999)yes)^bc/I
  14227. Capture group count = 0
  14228. Compile options: <none>
  14229. Overall options: anchored
  14230. Subject length lower bound = 2
  14231. # This should not be anchored.
  14232. /(?(VERSION>=999)yes|no)^bc/I
  14233. Capture group count = 0
  14234. Last code unit = 'c'
  14235. Subject length lower bound = 4
  14236. /(*LIMIT_HEAP=0)xxx/I
  14237. Capture group count = 0
  14238. Heap limit = 0
  14239. First code unit = 'x'
  14240. Last code unit = 'x'
  14241. Subject length lower bound = 3
  14242. /\d{0,3}(*:abc)(?C1)xxx/callout_info
  14243. Callout 1 x
  14244. # ----------------------------------------------------------------------
  14245. # These are a whole pile of tests that touch lines of code that are not
  14246. # used by any other tests (at least when these were created).
  14247. /^a+?x/i,no_start_optimize,no_auto_possess
  14248. \= Expect no match
  14249. aaa
  14250. No match
  14251. /^[^a]{3,}?x/i,no_start_optimize,no_auto_possess
  14252. \= Expect no match
  14253. bbb
  14254. No match
  14255. cc
  14256. No match
  14257. /^X\S/no_start_optimize,no_auto_possess
  14258. \= Expect no match
  14259. X
  14260. No match
  14261. /^X\W/no_start_optimize,no_auto_possess
  14262. \= Expect no match
  14263. X
  14264. No match
  14265. /^X\H/no_start_optimize,no_auto_possess
  14266. \= Expect no match
  14267. X
  14268. No match
  14269. /^X\h/no_start_optimize,no_auto_possess
  14270. \= Expect no match
  14271. X
  14272. No match
  14273. /^X\V/no_start_optimize,no_auto_possess
  14274. \= Expect no match
  14275. X
  14276. No match
  14277. /^X\v/no_start_optimize,no_auto_possess
  14278. \= Expect no match
  14279. X
  14280. No match
  14281. /^X\h/no_start_optimize,no_auto_possess
  14282. \= Expect no match
  14283. XY
  14284. No match
  14285. /^X\V/no_start_optimize,no_auto_possess
  14286. \= Expect no match
  14287. X\n
  14288. No match
  14289. /^X\v/no_start_optimize,no_auto_possess
  14290. \= Expect no match
  14291. XX
  14292. No match
  14293. /^X.+?/s,no_start_optimize,no_auto_possess
  14294. \= Expect no match
  14295. X
  14296. No match
  14297. /^X\R+?/no_start_optimize,no_auto_possess
  14298. \= Expect no match
  14299. XX
  14300. No match
  14301. /^X\H+?/no_start_optimize,no_auto_possess
  14302. \= Expect no match
  14303. X
  14304. No match
  14305. /^X\h+?/no_start_optimize,no_auto_possess
  14306. \= Expect no match
  14307. X
  14308. No match
  14309. /^X\V+?/no_start_optimize,no_auto_possess
  14310. \= Expect no match
  14311. X
  14312. No match
  14313. X\n
  14314. No match
  14315. /^X\D+?/no_start_optimize,no_auto_possess
  14316. \= Expect no match
  14317. X
  14318. No match
  14319. X9
  14320. No match
  14321. /^X\S+?/no_start_optimize,no_auto_possess
  14322. \= Expect no match
  14323. X
  14324. No match
  14325. X\n
  14326. No match
  14327. /^X\W+?/no_start_optimize,no_auto_possess
  14328. \= Expect no match
  14329. X
  14330. No match
  14331. XX
  14332. No match
  14333. /^X.+?Z/no_start_optimize,no_auto_possess
  14334. \= Expect no match
  14335. XY\n
  14336. No match
  14337. /(*CRLF)^X.+?Z/no_start_optimize,no_auto_possess
  14338. \= Expect no match
  14339. XY\r\=ps
  14340. Partial match: XY\x0d
  14341. /^X\R+?Z/no_start_optimize,no_auto_possess
  14342. \= Expect no match
  14343. X\nX
  14344. No match
  14345. X\n\r\n
  14346. No match
  14347. X\n\rY
  14348. No match
  14349. X\n\nY
  14350. No match
  14351. X\n\x{0c}Y
  14352. No match
  14353. /(*BSR_ANYCRLF)^X\R+?Z/no_start_optimize,no_auto_possess
  14354. \= Expect no match
  14355. X\nX
  14356. No match
  14357. X\n\r\n
  14358. No match
  14359. X\n\rY
  14360. No match
  14361. X\n\nY
  14362. No match
  14363. X\n\x{0c}Y
  14364. No match
  14365. /^X\H+?Z/no_start_optimize,no_auto_possess
  14366. \= Expect no match
  14367. XY\t
  14368. No match
  14369. XYY
  14370. No match
  14371. /^X\h+?Z/no_start_optimize,no_auto_possess
  14372. \= Expect no match
  14373. X\t\t
  14374. No match
  14375. X\tY
  14376. No match
  14377. /^X\V+?Z/no_start_optimize,no_auto_possess
  14378. \= Expect no match
  14379. XY\n
  14380. No match
  14381. XYY
  14382. No match
  14383. /^X\v+?Z/no_start_optimize,no_auto_possess
  14384. \= Expect no match
  14385. X\n\n
  14386. No match
  14387. X\nY
  14388. No match
  14389. /^X\D+?Z/no_start_optimize,no_auto_possess
  14390. \= Expect no match
  14391. XY9
  14392. No match
  14393. XYY
  14394. No match
  14395. /^X\d+?Z/no_start_optimize,no_auto_possess
  14396. \= Expect no match
  14397. X99
  14398. No match
  14399. X9Y
  14400. No match
  14401. /^X\S+?Z/no_start_optimize,no_auto_possess
  14402. \= Expect no match
  14403. XY\n
  14404. No match
  14405. XYY
  14406. No match
  14407. /^X\s+?Z/no_start_optimize,no_auto_possess
  14408. \= Expect no match
  14409. X\n\n
  14410. No match
  14411. X\nY
  14412. No match
  14413. /^X\W+?Z/no_start_optimize,no_auto_possess
  14414. \= Expect no match
  14415. X.A
  14416. No match
  14417. X++
  14418. No match
  14419. /^X\w+?Z/no_start_optimize,no_auto_possess
  14420. \= Expect no match
  14421. Xa.
  14422. No match
  14423. Xaa
  14424. No match
  14425. /^X.{1,3}Z/s,no_start_optimize,no_auto_possess
  14426. \= Expect no match
  14427. Xa.bd
  14428. No match
  14429. /^X\h+Z/no_start_optimize,no_auto_possess
  14430. \= Expect no match
  14431. X\t\t
  14432. No match
  14433. X\tY
  14434. No match
  14435. /^X\V+Z/no_start_optimize,no_auto_possess
  14436. \= Expect no match
  14437. XY\n
  14438. No match
  14439. XYY
  14440. No match
  14441. /^(X(*THEN)Y|AB){0}(?1)/
  14442. ABX
  14443. 0: AB
  14444. \= Expect no match
  14445. XAB
  14446. No match
  14447. /^(?!A(?C1)B)C/
  14448. ABC\=callout_error=1,no_jit
  14449. No match
  14450. /^(?!A(?C1)B)C/no_start_optimize
  14451. ABC\=callout_error=1
  14452. --->ABC
  14453. 1 ^^ B
  14454. Failed: error -37: callout error code
  14455. /^(?(?!A(?C1)B)C)/
  14456. ABC\=callout_error=1
  14457. --->ABC
  14458. 1 ^^ B
  14459. Failed: error -37: callout error code
  14460. # ----------------------------------------------------------------------
  14461. /[a b c]/BxxI
  14462. ------------------------------------------------------------------
  14463. Bra
  14464. [a-c]
  14465. Ket
  14466. End
  14467. ------------------------------------------------------------------
  14468. Capture group count = 0
  14469. Options: extended_more
  14470. Starting code units: a b c
  14471. Subject length lower bound = 1
  14472. /[a b c]/BxxxI
  14473. ------------------------------------------------------------------
  14474. Bra
  14475. [a-c]
  14476. Ket
  14477. End
  14478. ------------------------------------------------------------------
  14479. Capture group count = 0
  14480. Options: extended extended_more
  14481. Starting code units: a b c
  14482. Subject length lower bound = 1
  14483. /[a b c]/B,extended_more
  14484. ------------------------------------------------------------------
  14485. Bra
  14486. [a-c]
  14487. Ket
  14488. End
  14489. ------------------------------------------------------------------
  14490. /[ a b c ]/B,extended_more
  14491. ------------------------------------------------------------------
  14492. Bra
  14493. [a-c]
  14494. Ket
  14495. End
  14496. ------------------------------------------------------------------
  14497. /[a b](?xx: [ 12 ] (?-xx:[ 34 ]) )y z/B
  14498. ------------------------------------------------------------------
  14499. Bra
  14500. [ ab]
  14501. Bra
  14502. [12]
  14503. Bra
  14504. [ 34]
  14505. Ket
  14506. Ket
  14507. y z
  14508. Ket
  14509. End
  14510. ------------------------------------------------------------------
  14511. # Unsetting /x also unsets /xx
  14512. /[a b](?xx: [ 12 ] (?-x:[ 34 ]) )y z/B
  14513. ------------------------------------------------------------------
  14514. Bra
  14515. [ ab]
  14516. Bra
  14517. [12]
  14518. Bra
  14519. [ 34]
  14520. Ket
  14521. Ket
  14522. y z
  14523. Ket
  14524. End
  14525. ------------------------------------------------------------------
  14526. /(a)(?-n:(b))(c)/nB
  14527. ------------------------------------------------------------------
  14528. Bra
  14529. Bra
  14530. a
  14531. Ket
  14532. Bra
  14533. CBra 1
  14534. b
  14535. Ket
  14536. Ket
  14537. Bra
  14538. c
  14539. Ket
  14540. Ket
  14541. End
  14542. ------------------------------------------------------------------
  14543. # ----------------------------------------------------------------------
  14544. # These test the dangerous PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL option.
  14545. /\j\x{z}\o{82}\L\uabcd\u\U\g{\g/B,\bad_escape_is_literal
  14546. ** Unrecognized modifier '\' in '\bad_escape_is_literal'
  14547. /\N{\c/IB,bad_escape_is_literal
  14548. ------------------------------------------------------------------
  14549. Bra
  14550. N{c
  14551. Ket
  14552. End
  14553. ------------------------------------------------------------------
  14554. Capture group count = 0
  14555. Extra options: bad_escape_is_literal
  14556. First code unit = 'N'
  14557. Last code unit = 'c'
  14558. Subject length lower bound = 3
  14559. /[\j\x{z}\o\gAb\g]/B,bad_escape_is_literal
  14560. ------------------------------------------------------------------
  14561. Bra
  14562. [Abgjoxz{}]
  14563. Ket
  14564. End
  14565. ------------------------------------------------------------------
  14566. /[Q-\N]/B,bad_escape_is_literal
  14567. Failed: error 150 at offset 5: invalid range in character class
  14568. /[\s-_]/bad_escape_is_literal
  14569. Failed: error 150 at offset 3: invalid range in character class
  14570. /[_-\s]/bad_escape_is_literal
  14571. Failed: error 150 at offset 5: invalid range in character class
  14572. /[\B\R\X]/B
  14573. Failed: error 107 at offset 2: escape sequence is invalid in character class
  14574. /[\B\R\X]/B,bad_escape_is_literal
  14575. Failed: error 107 at offset 2: escape sequence is invalid in character class
  14576. /[A-\BP-\RV-\X]/B
  14577. Failed: error 107 at offset 4: escape sequence is invalid in character class
  14578. /[A-\BP-\RV-\X]/B,bad_escape_is_literal
  14579. Failed: error 107 at offset 4: escape sequence is invalid in character class
  14580. # ----------------------------------------------------------------------
  14581. /a\b(c/literal
  14582. a\\b(c
  14583. 0: a\b(c
  14584. /a\b(c/literal,caseless
  14585. a\\b(c
  14586. 0: a\b(c
  14587. a\\B(c
  14588. 0: a\B(c
  14589. /a\b(c/literal,firstline
  14590. XYYa\\b(c
  14591. 0: a\b(c
  14592. \= Expect no match
  14593. X\na\\b(c
  14594. No match
  14595. /a\b?c/literal,use_offset_limit
  14596. XXXXa\\b?c\=offset_limit=4
  14597. 0: a\b?c
  14598. \= Expect no match
  14599. XXXXa\\b?c\=offset_limit=3
  14600. No match
  14601. /a\b(c/literal,anchored,endanchored
  14602. a\\b(c
  14603. 0: a\b(c
  14604. \= Expect no match
  14605. Xa\\b(c
  14606. No match
  14607. a\\b(cX
  14608. No match
  14609. Xa\\b(cX
  14610. No match
  14611. //literal,extended
  14612. Failed: error 192 at offset 0: invalid option bits with PCRE2_LITERAL
  14613. /a\b(c/literal,auto_callout,no_start_optimize
  14614. XXXXa\\b(c
  14615. --->XXXXa\b(c
  14616. +0 ^ a
  14617. +0 ^ a
  14618. +0 ^ a
  14619. +0 ^ a
  14620. +0 ^ a
  14621. +1 ^^ \
  14622. +2 ^ ^ b
  14623. +3 ^ ^ (
  14624. +4 ^ ^ c
  14625. +5 ^ ^ End of pattern
  14626. 0: a\b(c
  14627. /a\b(c/literal,auto_callout
  14628. XXXXa\\b(c
  14629. --->XXXXa\b(c
  14630. +0 ^ a
  14631. +1 ^^ \
  14632. +2 ^ ^ b
  14633. +3 ^ ^ (
  14634. +4 ^ ^ c
  14635. +5 ^ ^ End of pattern
  14636. 0: a\b(c
  14637. /(*CR)abc/literal
  14638. (*CR)abc
  14639. 0: (*CR)abc
  14640. /cat|dog/I,match_word
  14641. Capture group count = 0
  14642. Max lookbehind = 1
  14643. Extra options: match_word
  14644. Starting code units: c d
  14645. Subject length lower bound = 3
  14646. the cat sat
  14647. 0: cat
  14648. \= Expect no match
  14649. caterpillar
  14650. No match
  14651. snowcat
  14652. No match
  14653. syndicate
  14654. No match
  14655. /(cat)|dog/I,match_line,literal
  14656. Capture group count = 0
  14657. Compile options: literal
  14658. Overall options: anchored literal
  14659. Extra options: match_line
  14660. First code unit = '('
  14661. Subject length lower bound = 9
  14662. (cat)|dog
  14663. 0: (cat)|dog
  14664. \= Expect no match
  14665. the cat sat
  14666. No match
  14667. caterpillar
  14668. No match
  14669. snowcat
  14670. No match
  14671. syndicate
  14672. No match
  14673. /a whole line/match_line,multiline
  14674. Rhubarb \na whole line\n custard
  14675. 0: a whole line
  14676. \= Expect no match
  14677. Not a whole line
  14678. No match
  14679. # Perl gets this wrong, failing to capture 'b' in group 1.
  14680. /^(b+|a){1,2}?bc/
  14681. bbc
  14682. 0: bbc
  14683. 1: b
  14684. # And again here, for the "babc" subject string.
  14685. /^(b*|ba){1,2}?bc/
  14686. babc
  14687. 0: babc
  14688. 1: ba
  14689. bbabc
  14690. 0: bbabc
  14691. 1: ba
  14692. bababc
  14693. 0: bababc
  14694. 1: ba
  14695. \= Expect no match
  14696. bababbc
  14697. No match
  14698. babababc
  14699. No match
  14700. /[[:digit:]-a]/
  14701. Failed: error 150 at offset 10: invalid range in character class
  14702. /[[:digit:]-[:print:]]/
  14703. Failed: error 150 at offset 10: invalid range in character class
  14704. /[\d-a]/
  14705. Failed: error 150 at offset 3: invalid range in character class
  14706. /[\H-z]/
  14707. Failed: error 150 at offset 3: invalid range in character class
  14708. /[\d-[:print:]]/
  14709. Failed: error 150 at offset 3: invalid range in character class
  14710. # Perl gets the second of these wrong, giving no match.
  14711. "(?<=(a))\1?b"I
  14712. Capture group count = 1
  14713. Max back reference = 1
  14714. Max lookbehind = 1
  14715. Last code unit = 'b'
  14716. Subject length lower bound = 1
  14717. ab
  14718. 0: b
  14719. 1: a
  14720. aaab
  14721. 0: ab
  14722. 1: a
  14723. "(?=(a))\1?b"I
  14724. Capture group count = 1
  14725. Max back reference = 1
  14726. First code unit = 'a'
  14727. Last code unit = 'b'
  14728. Subject length lower bound = 2
  14729. ab
  14730. 0: ab
  14731. 1: a
  14732. aaab
  14733. 0: ab
  14734. 1: a
  14735. # JIT does not support callout_extra
  14736. /(*NO_JIT)(a+)b/auto_callout,no_start_optimize,no_auto_possess
  14737. \= Expect no match
  14738. aac\=callout_extra
  14739. New match attempt
  14740. --->aac
  14741. +9 ^ (
  14742. +10 ^ a+
  14743. +12 ^ ^ )
  14744. +13 ^ ^ b
  14745. Backtrack
  14746. --->aac
  14747. +12 ^^ )
  14748. +13 ^^ b
  14749. Backtrack
  14750. No other matching paths
  14751. New match attempt
  14752. --->aac
  14753. +9 ^ (
  14754. +10 ^ a+
  14755. +12 ^^ )
  14756. +13 ^^ b
  14757. Backtrack
  14758. No other matching paths
  14759. New match attempt
  14760. --->aac
  14761. +9 ^ (
  14762. +10 ^ a+
  14763. Backtrack
  14764. No other matching paths
  14765. New match attempt
  14766. --->aac
  14767. +9 ^ (
  14768. +10 ^ a+
  14769. No match
  14770. /(*NO_JIT)a+(?C'XXX')b/no_start_optimize,no_auto_possess
  14771. \= Expect no match
  14772. aac\=callout_extra
  14773. New match attempt
  14774. Callout (15): 'XXX'
  14775. --->aac
  14776. ^ ^ b
  14777. Backtrack
  14778. Callout (15): 'XXX'
  14779. --->aac
  14780. ^^ b
  14781. Backtrack
  14782. No other matching paths
  14783. New match attempt
  14784. Callout (15): 'XXX'
  14785. --->aac
  14786. ^^ b
  14787. No match
  14788. /\n/firstline
  14789. xyz\nabc
  14790. 0: \x0a
  14791. /\nabc/firstline
  14792. xyz\nabc
  14793. 0: \x0aabc
  14794. /\x{0a}abc/firstline,newline=crlf
  14795. \= Expect no match
  14796. xyz\r\nabc
  14797. No match
  14798. /[abc]/firstline
  14799. \= Expect no match
  14800. \na
  14801. No match
  14802. # These tests are matched in test 1 as they are Perl compatible. Here we are
  14803. # looking at what does and does not get auto-possessified.
  14804. /(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$/B
  14805. ------------------------------------------------------------------
  14806. Bra
  14807. Cond
  14808. Cond false
  14809. CBra 1
  14810. a?
  14811. Ket
  14812. Ket
  14813. ^
  14814. Recurse
  14815. a
  14816. $
  14817. Ket
  14818. End
  14819. ------------------------------------------------------------------
  14820. /(?(DEFINE)(?<optional_a>a?)X)^(?&optional_a)a$/B
  14821. ------------------------------------------------------------------
  14822. Bra
  14823. Cond
  14824. Cond false
  14825. CBra 1
  14826. a?
  14827. Ket
  14828. X
  14829. Ket
  14830. ^
  14831. Recurse
  14832. a
  14833. $
  14834. Ket
  14835. End
  14836. ------------------------------------------------------------------
  14837. /^(a?)b(?1)a/B
  14838. ------------------------------------------------------------------
  14839. Bra
  14840. ^
  14841. CBra 1
  14842. a?
  14843. Ket
  14844. b
  14845. Recurse
  14846. a
  14847. Ket
  14848. End
  14849. ------------------------------------------------------------------
  14850. /^(a?)+b(?1)a/B
  14851. ------------------------------------------------------------------
  14852. Bra
  14853. ^
  14854. SCBra 1
  14855. a?
  14856. KetRmax
  14857. b
  14858. Recurse
  14859. a
  14860. Ket
  14861. End
  14862. ------------------------------------------------------------------
  14863. /^(a?)++b(?1)a/B
  14864. ------------------------------------------------------------------
  14865. Bra
  14866. ^
  14867. SCBraPos 1
  14868. a?
  14869. KetRpos
  14870. b
  14871. Recurse
  14872. a
  14873. Ket
  14874. End
  14875. ------------------------------------------------------------------
  14876. /^(a?)+b/B
  14877. ------------------------------------------------------------------
  14878. Bra
  14879. ^
  14880. SCBra 1
  14881. a?
  14882. KetRmax
  14883. b
  14884. Ket
  14885. End
  14886. ------------------------------------------------------------------
  14887. /(?=a+)a(a+)++b/B
  14888. ------------------------------------------------------------------
  14889. Bra
  14890. Assert
  14891. a++
  14892. Ket
  14893. a
  14894. CBraPos 1
  14895. a++
  14896. KetRpos
  14897. b
  14898. Ket
  14899. End
  14900. ------------------------------------------------------------------
  14901. /(?<=(?=.){4,5}x)/B
  14902. ------------------------------------------------------------------
  14903. Bra
  14904. Assert back
  14905. Reverse
  14906. Assert
  14907. Any
  14908. Ket
  14909. Assert
  14910. Any
  14911. Ket
  14912. Assert
  14913. Any
  14914. Ket
  14915. Assert
  14916. Any
  14917. Ket
  14918. Brazero
  14919. Assert
  14920. Any
  14921. Ket
  14922. x
  14923. Ket
  14924. Ket
  14925. End
  14926. ------------------------------------------------------------------
  14927. # Perl behaves differently with these when optimization is turned off
  14928. /a(*PRUNE:X)bc|qq/mark,no_start_optimize
  14929. \= Expect no match
  14930. axy
  14931. No match, mark = X
  14932. /a(*THEN:X)bc|qq/mark,no_start_optimize
  14933. \= Expect no match
  14934. axy
  14935. No match, mark = X
  14936. /(?^x-i)AB/
  14937. Failed: error 194 at offset 4: invalid hyphen in option setting
  14938. /(?^-i)AB/
  14939. Failed: error 194 at offset 3: invalid hyphen in option setting
  14940. /(?x-i-i)/
  14941. Failed: error 194 at offset 5: invalid hyphen in option setting
  14942. /(?(?=^))b/I
  14943. Capture group count = 0
  14944. Last code unit = 'b'
  14945. Subject length lower bound = 1
  14946. abc
  14947. 0: b
  14948. /(?(?=^)|)b/I
  14949. Capture group count = 0
  14950. First code unit = 'b'
  14951. Subject length lower bound = 1
  14952. abc
  14953. 0: b
  14954. /(?(?=^)|^)b/I
  14955. Capture group count = 0
  14956. Compile options: <none>
  14957. Overall options: anchored
  14958. First code unit = 'b'
  14959. Subject length lower bound = 1
  14960. bbc
  14961. 0: b
  14962. \= Expect no match
  14963. abc
  14964. No match
  14965. /(?(1)^|^())/I
  14966. Capture group count = 1
  14967. Max back reference = 1
  14968. May match empty string
  14969. Compile options: <none>
  14970. Overall options: anchored
  14971. Subject length lower bound = 0
  14972. /(?(1)^())b/I
  14973. Capture group count = 1
  14974. Max back reference = 1
  14975. Last code unit = 'b'
  14976. Subject length lower bound = 1
  14977. /(?(1)^())+b/I,aftertext
  14978. Capture group count = 1
  14979. Max back reference = 1
  14980. Last code unit = 'b'
  14981. Subject length lower bound = 1
  14982. abc
  14983. 0: b
  14984. 0+ c
  14985. /(?(1)^()|^)+b/I,aftertext
  14986. Capture group count = 1
  14987. Max back reference = 1
  14988. Compile options: <none>
  14989. Overall options: anchored
  14990. First code unit = 'b'
  14991. Subject length lower bound = 1
  14992. bbc
  14993. 0: b
  14994. 0+ bc
  14995. \= Expect no match
  14996. abc
  14997. No match
  14998. /(?(1)^()|^)*b/I,aftertext
  14999. Capture group count = 1
  15000. Max back reference = 1
  15001. First code unit = 'b'
  15002. Subject length lower bound = 1
  15003. bbc
  15004. 0: b
  15005. 0+ bc
  15006. abc
  15007. 0: b
  15008. 0+ c
  15009. xbc
  15010. 0: b
  15011. 0+ c
  15012. /(?(1)^())+b/I,aftertext
  15013. Capture group count = 1
  15014. Max back reference = 1
  15015. Last code unit = 'b'
  15016. Subject length lower bound = 1
  15017. abc
  15018. 0: b
  15019. 0+ c
  15020. /(?(1)^a()|^a)+b/I,aftertext
  15021. Capture group count = 1
  15022. Max back reference = 1
  15023. Compile options: <none>
  15024. Overall options: anchored
  15025. First code unit = 'a'
  15026. Last code unit = 'b'
  15027. Subject length lower bound = 2
  15028. abc
  15029. 0: ab
  15030. 0+ c
  15031. \= Expect no match
  15032. bbc
  15033. No match
  15034. /(?(1)^|^(a))+b/I,aftertext
  15035. Capture group count = 1
  15036. Max back reference = 1
  15037. Compile options: <none>
  15038. Overall options: anchored
  15039. Last code unit = 'b'
  15040. Subject length lower bound = 1
  15041. abc
  15042. 0: ab
  15043. 0+ c
  15044. 1: a
  15045. \= Expect no match
  15046. bbc
  15047. No match
  15048. /(?(1)^a()|^a)*b/I,aftertext
  15049. Capture group count = 1
  15050. Max back reference = 1
  15051. Last code unit = 'b'
  15052. Subject length lower bound = 1
  15053. abc
  15054. 0: ab
  15055. 0+ c
  15056. bbc
  15057. 0: b
  15058. 0+ bc
  15059. xbc
  15060. 0: b
  15061. 0+ c
  15062. /a(b)c|xyz/g,allvector,replace=<$0>
  15063. abcdefabcpqr\=ovector=4
  15064. 2: <abc>def<abc>pqr
  15065. 0: 6 9
  15066. 1: 7 8
  15067. 2: <unchanged>
  15068. 3: <unchanged>
  15069. abxyz\=ovector=4
  15070. 1: ab<xyz>
  15071. 0: 2 5
  15072. 1: <unset>
  15073. 2: <unchanged>
  15074. 3: <unchanged>
  15075. abcdefxyz\=ovector=4
  15076. 2: <abc>def<xyz>
  15077. 0: 6 9
  15078. 1: <unset>
  15079. 2: <unchanged>
  15080. 3: <unchanged>
  15081. /a(b)c|xyz/allvector
  15082. abcdef\=ovector=4
  15083. 0: abc
  15084. 1: b
  15085. 2: <unchanged>
  15086. 3: <unchanged>
  15087. abxyz\=ovector=4
  15088. 0: xyz
  15089. 1: <unset>
  15090. 2: <unchanged>
  15091. 3: <unchanged>
  15092. /a(b)c|xyz/g,replace=<$0>,substitute_callout
  15093. abcdefabcpqr
  15094. 1(2) Old 0 3 "abc" New 0 5 "<abc>"
  15095. 2(2) Old 6 9 "abc" New 8 13 "<abc>"
  15096. 2: <abc>def<abc>pqr
  15097. abxyzpqrabcxyz
  15098. 1(1) Old 2 5 "xyz" New 2 7 "<xyz>"
  15099. 2(2) Old 8 11 "abc" New 10 15 "<abc>"
  15100. 3(1) Old 11 14 "xyz" New 15 20 "<xyz>"
  15101. 3: ab<xyz>pqr<abc><xyz>
  15102. 12abc34xyz99abc55\=substitute_stop=2
  15103. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15104. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
  15105. 2: 12<abc>34xyz99abc55
  15106. 12abc34xyz99abc55\=substitute_skip=1
  15107. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15108. 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
  15109. 3(2) Old 12 15 "abc" New 14 19 "<abc>"
  15110. 3: 12abc34<xyz>99<abc>55
  15111. 12abc34xyz99abc55\=substitute_skip=2
  15112. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15113. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> SKIPPED"
  15114. 3(2) Old 12 15 "abc" New 14 19 "<abc>"
  15115. 3: 12<abc>34xyz99<abc>55
  15116. /a(b)c|xyz/g,replace=<$0>
  15117. abcdefabcpqr
  15118. 2: <abc>def<abc>pqr
  15119. abxyzpqrabcxyz
  15120. 3: ab<xyz>pqr<abc><xyz>
  15121. 12abc34xyz\=substitute_stop=2
  15122. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15123. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
  15124. 2: 12<abc>34xyz
  15125. 12abc34xyz\=substitute_skip=1
  15126. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15127. 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
  15128. 2: 12abc34<xyz>
  15129. /a(b)c|xyz/replace=<$0>
  15130. abcdefabcpqr
  15131. 1: <abc>defabcpqr
  15132. 12abc34xyz\=substitute_skip=1
  15133. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15134. 1: 12abc34xyz
  15135. 12abc34xyz\=substitute_stop=1
  15136. 1(2) Old 2 5 "abc" New 2 7 "<abc> STOPPED"
  15137. 1: 12abc34xyz
  15138. /abc\rdef/
  15139. abc\ndef
  15140. No match
  15141. /abc\rdef\x{0d}xyz/escaped_cr_is_lf
  15142. abc\ndef\rxyz
  15143. 0: abc\x0adef\x0dxyz
  15144. \= Expect no match
  15145. abc\ndef\nxyz
  15146. No match
  15147. /(?(*ACCEPT)xxx)/
  15148. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  15149. /(?(*atomic:xx)xxx)/
  15150. Failed: error 128 at offset 10: assertion expected after (?( or (?(?C)
  15151. /(?(*script_run:xxx)zzz)/
  15152. Failed: error 128 at offset 14: assertion expected after (?( or (?(?C)
  15153. /foobar/
  15154. the foobar thing\=copy_matched_subject
  15155. 0: foobar
  15156. the foobar thing\=copy_matched_subject,zero_terminate
  15157. 0: foobar
  15158. /foobar/g
  15159. the foobar thing foobar again\=copy_matched_subject
  15160. 0: foobar
  15161. 0: foobar
  15162. /(*:XX)^abc/I
  15163. Capture group count = 0
  15164. Compile options: <none>
  15165. Overall options: anchored
  15166. First code unit = 'a'
  15167. Subject length lower bound = 3
  15168. /(*COMMIT:XX)^abc/I
  15169. Capture group count = 0
  15170. Compile options: <none>
  15171. Overall options: anchored
  15172. First code unit = 'a'
  15173. Subject length lower bound = 3
  15174. /(*ACCEPT:XX)^abc/I
  15175. Capture group count = 0
  15176. May match empty string
  15177. Subject length lower bound = 0
  15178. /abc/replace=xyz
  15179. abc\=null_context
  15180. 1: xyz
  15181. /abc/replace=xyz,substitute_callout
  15182. abc
  15183. 1(1) Old 0 3 "abc" New 0 3 "xyz"
  15184. 1: xyz
  15185. \= Expect error message
  15186. abc\=null_context
  15187. ** Replacement callouts are not supported with null_context.
  15188. /\[()]{65535}()/expand
  15189. Failed: error 197 at offset 131071: too many capturing groups (maximum 65535)
  15190. /\[()]{65535}(?<A>)/expand
  15191. Failed: error 197 at offset 131075: too many capturing groups (maximum 65535)
  15192. /a(?:(*ACCEPT))??bc/
  15193. abc
  15194. 0: abc
  15195. axy
  15196. 0: a
  15197. /a(*ACCEPT)??bc/
  15198. abc
  15199. 0: abc
  15200. axy
  15201. 0: a
  15202. /a(*ACCEPT:XX)??bc/mark
  15203. abc
  15204. 0: abc
  15205. axy
  15206. 0: a
  15207. MK: XX
  15208. /(*:\)?/
  15209. Failed: error 109 at offset 5: quantifier does not follow a repeatable item
  15210. /(*:\Q \E){5}/alt_verbnames
  15211. Failed: error 109 at offset 11: quantifier does not follow a repeatable item
  15212. /(?=abc)/I
  15213. Capture group count = 0
  15214. May match empty string
  15215. First code unit = 'a'
  15216. Last code unit = 'c'
  15217. Subject length lower bound = 2
  15218. /(?|(X)|(XY))\1abc/I
  15219. Capture group count = 1
  15220. Max back reference = 1
  15221. First code unit = 'X'
  15222. Last code unit = 'c'
  15223. Subject length lower bound = 4
  15224. /(?|(a)|(bcde))(c)\2/I
  15225. Capture group count = 2
  15226. Max back reference = 2
  15227. Starting code units: a b
  15228. Last code unit = 'c'
  15229. Subject length lower bound = 3
  15230. /(?|(a)|(bcde))(c)\1/I
  15231. Capture group count = 2
  15232. Max back reference = 1
  15233. Starting code units: a b
  15234. Last code unit = 'c'
  15235. Subject length lower bound = 2
  15236. /(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'B'(?'A')/I,dupnames
  15237. Capture group count = 3
  15238. Max back reference = 2
  15239. Named capture groups:
  15240. A 1
  15241. A 3
  15242. B 2
  15243. Options: dupnames
  15244. Starting code units: a b
  15245. Last code unit = 'c'
  15246. Subject length lower bound = 3
  15247. /(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'A'(?'A')/I,dupnames
  15248. Capture group count = 3
  15249. Max back reference = 3
  15250. Named capture groups:
  15251. A 1
  15252. A 3
  15253. B 2
  15254. Options: dupnames
  15255. Starting code units: a b
  15256. Last code unit = 'c'
  15257. Subject length lower bound = 2
  15258. /((a|)+)+Z/I
  15259. Capture group count = 2
  15260. Starting code units: Z a
  15261. Last code unit = 'Z'
  15262. Subject length lower bound = 1
  15263. /((?=a))[abcd]/I
  15264. Capture group count = 1
  15265. First code unit = 'a'
  15266. Subject length lower bound = 1
  15267. /A(?:(*ACCEPT))?B/info
  15268. Capture group count = 0
  15269. First code unit = 'A'
  15270. Subject length lower bound = 1
  15271. /(A(*ACCEPT)??B)C/
  15272. ABC
  15273. 0: ABC
  15274. 1: AB
  15275. AXY
  15276. 0: A
  15277. 1: A
  15278. /(?<=(?<=a)b)c.*/I
  15279. Capture group count = 0
  15280. Max lookbehind = 1
  15281. First code unit = 'c'
  15282. Subject length lower bound = 1
  15283. abc\=ph
  15284. Partial match: c
  15285. \= Expect no match
  15286. xbc\=ph
  15287. No match
  15288. /(?<=ab)c.*/I
  15289. Capture group count = 0
  15290. Max lookbehind = 2
  15291. First code unit = 'c'
  15292. Subject length lower bound = 1
  15293. abc\=ph
  15294. Partial match: c
  15295. \= Expect no match
  15296. xbc\=ph
  15297. No match
  15298. /(?<=a(?<=a|a)c)/I
  15299. Capture group count = 0
  15300. Max lookbehind = 2
  15301. May match empty string
  15302. Subject length lower bound = 0
  15303. /(?<=a(?<=a|ba)c)/I
  15304. Capture group count = 0
  15305. Max lookbehind = 2
  15306. May match empty string
  15307. Subject length lower bound = 0
  15308. /(?<=(?<=a)b)(?<!abcd)/I
  15309. Capture group count = 0
  15310. Max lookbehind = 4
  15311. May match empty string
  15312. Subject length lower bound = 0
  15313. /(?<=(?<=a)b)(?<!abcd)(?<=(?<=a)bcde)/I
  15314. Capture group count = 0
  15315. Max lookbehind = 4
  15316. May match empty string
  15317. Subject length lower bound = 0
  15318. # Addition overflow
  15319. /( {32742} {42})(?<!\1{65481})/
  15320. Failed: error 187 at offset 15: lookbehind assertion is too long
  15321. # Multiplication overflow
  15322. /(X{65535})(?<=\1{32770})/
  15323. Failed: error 187 at offset 10: lookbehind assertion is too long
  15324. # ---- Non-atomic assertion tests ----
  15325. # Expect error: not allowed as a condition
  15326. /(?(*napla:xx)bc)/
  15327. Failed: error 198 at offset 9: atomic assertion expected after (?( or (?(?C)
  15328. /\A(*pla:.*\b(\w++))(?>.*?\b\1\b){3}/
  15329. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15330. No match
  15331. /\A(*napla:.*\b(\w++))(?>.*?\b\1\b){3}/
  15332. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15333. 0: word1 word3 word1 word2 word3 word2 word2 word1 word3
  15334. 1: word3
  15335. /\A(?*.*\b(\w++))(?>.*?\b\1\b){3}/
  15336. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15337. 0: word1 word3 word1 word2 word3 word2 word2 word1 word3
  15338. 1: word3
  15339. /(*plb:(.)..|(.)...)(\1|\2)/
  15340. abcdb\=offset=4
  15341. 0: b
  15342. 1: b
  15343. 2: <unset>
  15344. 3: b
  15345. abcda\=offset=4
  15346. No match
  15347. /(*naplb:(.)..|(.)...)(\1|\2)/
  15348. abcdb\=offset=4
  15349. 0: b
  15350. 1: b
  15351. 2: <unset>
  15352. 3: b
  15353. abcda\=offset=4
  15354. 0: a
  15355. 1: <unset>
  15356. 2: a
  15357. 3: a
  15358. /(?<*(.)..|(.)...)(\1|\2)/
  15359. abcdb\=offset=4
  15360. 0: b
  15361. 1: b
  15362. 2: <unset>
  15363. 3: b
  15364. abcda\=offset=4
  15365. 0: a
  15366. 1: <unset>
  15367. 2: a
  15368. 3: a
  15369. /(*non_atomic_positive_lookahead:ab)/B
  15370. ------------------------------------------------------------------
  15371. Bra
  15372. Non-atomic assert
  15373. ab
  15374. Ket
  15375. Ket
  15376. End
  15377. ------------------------------------------------------------------
  15378. /(*non_atomic_positive_lookbehind:ab)/B
  15379. ------------------------------------------------------------------
  15380. Bra
  15381. Non-atomic assert back
  15382. Reverse
  15383. ab
  15384. Ket
  15385. Ket
  15386. End
  15387. ------------------------------------------------------------------
  15388. /(*pla:ab+)/B
  15389. ------------------------------------------------------------------
  15390. Bra
  15391. Assert
  15392. a
  15393. b++
  15394. Ket
  15395. Ket
  15396. End
  15397. ------------------------------------------------------------------
  15398. /(*napla:ab+)/B
  15399. ------------------------------------------------------------------
  15400. Bra
  15401. Non-atomic assert
  15402. a
  15403. b+
  15404. Ket
  15405. Ket
  15406. End
  15407. ------------------------------------------------------------------
  15408. /(*napla:)+/
  15409. /(*naplb:)+/
  15410. /(*napla:^x|^y)/I
  15411. Capture group count = 0
  15412. May match empty string
  15413. Compile options: <none>
  15414. Overall options: anchored
  15415. Starting code units: x y
  15416. Subject length lower bound = 1
  15417. /(*napla:abc|abd)/I
  15418. Capture group count = 0
  15419. May match empty string
  15420. First code unit = 'a'
  15421. Subject length lower bound = 1
  15422. /(*napla:a|(.)(*ACCEPT)zz)\1../
  15423. abcd
  15424. 0: abc
  15425. 1: a
  15426. /(*napla:a(*ACCEPT)zz|(.))\1../
  15427. abcd
  15428. 0: bcd
  15429. 1: b
  15430. /(*napla:a|(*COMMIT)(.))\1\1/
  15431. aabc
  15432. 0: aa
  15433. 1: a
  15434. \= Expect no match
  15435. abbc
  15436. No match
  15437. /(*napla:a|(.))\1\1/
  15438. aabc
  15439. 0: aa
  15440. 1: a
  15441. abbc
  15442. 0: bb
  15443. 1: b
  15444. /(*naplb:ab?c|PQ).../g
  15445. abcdefgacxyzPQR123
  15446. 0: def
  15447. 0: xyz
  15448. 0: R12
  15449. # ----
  15450. # Expect error (recursion => not fixed length)
  15451. /(\2)((?=(?<=\1)))/
  15452. Failed: error 125 at offset 8: length of lookbehind assertion is not limited
  15453. /c*+(?<=[bc])/
  15454. abc\=ph
  15455. Partial match: c
  15456. ab\=ph
  15457. Partial match:
  15458. abc\=ps
  15459. 0: c
  15460. ab\=ps
  15461. 0:
  15462. /c++(?<=[bc])/
  15463. abc\=ph
  15464. Partial match: c
  15465. ab\=ph
  15466. Partial match:
  15467. /(?<=(?=.(?<=x)))/
  15468. abx
  15469. 0:
  15470. ab\=ph
  15471. Partial match:
  15472. bxyz
  15473. 0:
  15474. xyz
  15475. 0:
  15476. /\z/
  15477. abc\=ph
  15478. Partial match:
  15479. abc\=ps
  15480. 0:
  15481. /\Z/
  15482. abc\=ph
  15483. Partial match:
  15484. abc\=ps
  15485. 0:
  15486. abc\n\=ph
  15487. Partial match: \x0a
  15488. abc\n\=ps
  15489. 0:
  15490. /(?![ab]).*/
  15491. ab\=ph
  15492. Partial match:
  15493. /c*+/
  15494. ab\=ph,offset=2
  15495. Partial match:
  15496. /\A\s*(a|(?:[^`]{28500}){4})/I
  15497. Capture group count = 1
  15498. Max lookbehind = 1
  15499. Compile options: <none>
  15500. Overall options: anchored
  15501. Subject length lower bound = 1
  15502. a
  15503. 0: a
  15504. 1: a
  15505. /\A\s*((?:[^`]{28500}){4})/I
  15506. Capture group count = 1
  15507. Max lookbehind = 1
  15508. Compile options: <none>
  15509. Overall options: anchored
  15510. Subject length lower bound = 65535
  15511. /\A\s*((?:[^`]{28500}){4}|a)/I
  15512. Capture group count = 1
  15513. Max lookbehind = 1
  15514. Compile options: <none>
  15515. Overall options: anchored
  15516. Subject length lower bound = 1
  15517. a
  15518. 0: a
  15519. 1: a
  15520. /(?<A>a)(?(<A>)b)((?<=b).*)/B
  15521. ------------------------------------------------------------------
  15522. Bra
  15523. CBra 1
  15524. a
  15525. Ket
  15526. Cond
  15527. 1 Cond ref
  15528. b
  15529. Ket
  15530. CBra 2
  15531. Assert back
  15532. Reverse
  15533. b
  15534. Ket
  15535. Any*+
  15536. Ket
  15537. Ket
  15538. End
  15539. ------------------------------------------------------------------
  15540. /(?(1)b)((?<=b).*)/B
  15541. ------------------------------------------------------------------
  15542. Bra
  15543. Cond
  15544. 1 Cond ref
  15545. b
  15546. Ket
  15547. CBra 1
  15548. Assert back
  15549. Reverse
  15550. b
  15551. Ket
  15552. Any*+
  15553. Ket
  15554. Ket
  15555. End
  15556. ------------------------------------------------------------------
  15557. /(?(R1)b)((?<=b).*)/B
  15558. ------------------------------------------------------------------
  15559. Bra
  15560. Cond
  15561. Cond recurse 1
  15562. b
  15563. Ket
  15564. CBra 1
  15565. Assert back
  15566. Reverse
  15567. b
  15568. Ket
  15569. Any*+
  15570. Ket
  15571. Ket
  15572. End
  15573. ------------------------------------------------------------------
  15574. /(?(DEFINE)b)((?<=b).*)/B
  15575. ------------------------------------------------------------------
  15576. Bra
  15577. Cond
  15578. Cond false
  15579. b
  15580. Ket
  15581. CBra 1
  15582. Assert back
  15583. Reverse
  15584. b
  15585. Ket
  15586. Any*+
  15587. Ket
  15588. Ket
  15589. End
  15590. ------------------------------------------------------------------
  15591. /(?(VERSION=10.3)b)((?<=b).*)/B
  15592. ------------------------------------------------------------------
  15593. Bra
  15594. Cond
  15595. Cond false
  15596. b
  15597. Ket
  15598. CBra 1
  15599. Assert back
  15600. Reverse
  15601. b
  15602. Ket
  15603. Any*+
  15604. Ket
  15605. Ket
  15606. End
  15607. ------------------------------------------------------------------
  15608. /[aA]b[cC]/IB
  15609. ------------------------------------------------------------------
  15610. Bra
  15611. /i a
  15612. b
  15613. /i c
  15614. Ket
  15615. End
  15616. ------------------------------------------------------------------
  15617. Capture group count = 0
  15618. First code unit = 'a' (caseless)
  15619. Last code unit = 'c' (caseless)
  15620. Subject length lower bound = 3
  15621. /[cc]abcd/I
  15622. Capture group count = 0
  15623. First code unit = 'c'
  15624. Last code unit = 'd'
  15625. Subject length lower bound = 5
  15626. /[Cc]abcd/I
  15627. Capture group count = 0
  15628. First code unit = 'C' (caseless)
  15629. Last code unit = 'd'
  15630. Subject length lower bound = 5
  15631. /[c]abcd/I
  15632. Capture group count = 0
  15633. First code unit = 'c'
  15634. Last code unit = 'd'
  15635. Subject length lower bound = 5
  15636. /(?:c|C)abcd/I
  15637. Capture group count = 0
  15638. First code unit = 'C' (caseless)
  15639. Last code unit = 'd'
  15640. Subject length lower bound = 5
  15641. /(a)?a/I
  15642. Capture group count = 1
  15643. Starting code units: a
  15644. Last code unit = 'a'
  15645. Subject length lower bound = 1
  15646. manm
  15647. 0: a
  15648. /^(?|(\*)(*napla:\S*_(\2?+.+))|(\w)(?=\S*_(\2?+\1)))+_\2$/
  15649. *abc_12345abc
  15650. 0: *abc_12345abc
  15651. 1: c
  15652. 2: 12345abc
  15653. /^(?|(\*)(*napla:\S*_(\3?+.+))|(\w)(?=\S*_((\2?+\1))))+_\2$/
  15654. *abc_12345abc
  15655. 0: *abc_12345abc
  15656. 1: c
  15657. 2: 12345abc
  15658. 3: 12345abc
  15659. /^((\1+)(?C)|\d)+133X$/
  15660. 111133X\=callout_capture
  15661. Callout 0: last capture = 2
  15662. 1: 1
  15663. 2: 111
  15664. --->111133X
  15665. ^ ^ |
  15666. Callout 0: last capture = 2
  15667. 1: 3
  15668. 2: 3
  15669. --->111133X
  15670. ^ ^ |
  15671. Callout 0: last capture = 2
  15672. 1: 1
  15673. 2: 11
  15674. --->111133X
  15675. ^ ^ |
  15676. Callout 0: last capture = 2
  15677. 1: 3
  15678. 2: 3
  15679. --->111133X
  15680. ^ ^ |
  15681. 0: 111133X
  15682. 1: 11
  15683. 2: 11
  15684. /abc/replace=xyz,substitute_replacement_only
  15685. 123abc456
  15686. 1: xyz
  15687. /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z,substitute_replacement_only
  15688. "abcde-abcde-"
  15689. 2: Xb+dZXb+dZ
  15690. /a(b)c|xyz/g,replace=<$0>,substitute_callout,substitute_replacement_only
  15691. abcdefabcpqr
  15692. 1(2) Old 0 3 "abc" New 0 5 "<abc>"
  15693. 2(2) Old 6 9 "abc" New 5 10 "<abc>"
  15694. 2: <abc><abc>
  15695. abxyzpqrabcxyz
  15696. 1(1) Old 2 5 "xyz" New 0 5 "<xyz>"
  15697. 2(2) Old 8 11 "abc" New 5 10 "<abc>"
  15698. 3(1) Old 11 14 "xyz" New 10 15 "<xyz>"
  15699. 3: <xyz><abc><xyz>
  15700. 12abc34xyz99abc55\=substitute_stop=2
  15701. 1(2) Old 2 5 "abc" New 0 5 "<abc>"
  15702. 2(1) Old 7 10 "xyz" New 5 10 "<xyz> STOPPED"
  15703. 2: <abc>
  15704. 12abc34xyz99abc55\=substitute_skip=1
  15705. 1(2) Old 2 5 "abc" New 0 5 "<abc> SKIPPED"
  15706. 2(1) Old 7 10 "xyz" New 0 5 "<xyz>"
  15707. 3(2) Old 12 15 "abc" New 5 10 "<abc>"
  15708. 3: <xyz><abc>
  15709. 12abc34xyz99abc55\=substitute_skip=2
  15710. 1(2) Old 2 5 "abc" New 0 5 "<abc>"
  15711. 2(1) Old 7 10 "xyz" New 5 10 "<xyz> SKIPPED"
  15712. 3(2) Old 12 15 "abc" New 5 10 "<abc>"
  15713. 3: <abc><abc>
  15714. /a(..)d/replace=>$1<,substitute_matched
  15715. xyzabcdxyzabcdxyz
  15716. 1: xyz>bc<xyzabcdxyz
  15717. xyzabcdxyzabcdxyz\=ovector=2
  15718. 1: xyz>bc<xyzabcdxyz
  15719. \= Expect error
  15720. xyzabcdxyzabcdxyz\=ovector=1
  15721. Failed: error -54 at offset 3 in replacement: requested value is not available
  15722. /a(..)d/g,replace=>$1<,substitute_matched
  15723. xyzabcdxyzabcdxyz
  15724. 2: xyz>bc<xyz>bc<xyz
  15725. xyzabcdxyzabcdxyz\=ovector=2
  15726. 2: xyz>bc<xyz>bc<xyz
  15727. \= Expect error
  15728. xyzabcdxyzabcdxyz\=ovector=1
  15729. Failed: error -54 at offset 3 in replacement: requested value is not available
  15730. xyzabcdxyzabcdxyz\=ovector=1,substitute_unset_empty
  15731. Failed: error -54 at offset 3 in replacement: requested value is not available
  15732. /55|a(..)d/g,replace=>$1<,substitute_matched
  15733. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15734. 3: xyz><>bc<xyz>bc<xyz
  15735. \= Expect error
  15736. xyz55abcdxyzabcdxyz\=ovector=2
  15737. Failed: error -55 at offset 3 in replacement: requested value is not set
  15738. /55|a(..)d/replace=>$1<,substitute_matched
  15739. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15740. 1: xyz><abcdxyzabcdxyz
  15741. /55|a(..)d/replace=>$1<
  15742. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15743. 1: xyz><abcdxyzabcdxyz
  15744. /55|a(..)d/g,replace=>$1<
  15745. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15746. 3: xyz><>bc<xyz>bc<xyz
  15747. /abc/replace=,caseless
  15748. XabcY
  15749. 0: abc
  15750. XABCY
  15751. 0: ABC
  15752. /abc/replace=[4],caseless
  15753. XabcY
  15754. 1: XY
  15755. XABCY
  15756. 1: XY
  15757. /abc/replace=*,caseless
  15758. XabcY
  15759. 1: X*Y
  15760. XABCY
  15761. 1: X*Y
  15762. XabcY\=replace=
  15763. 0: abc
  15764. # Expect non-fixed-length error
  15765. "(?<=X(?(DEFINE)(.*))(?1))."
  15766. Failed: error 125 at offset 0: length of lookbehind assertion is not limited
  15767. /\sxxx\s/tables=1
  15768. \= Expect no match
  15769. AB\x{85}xxx\x{a0}XYZ
  15770. No match
  15771. /\sxxx\s/tables=2
  15772. AB\x{85}xxx\x{a0}XYZ
  15773. 0: \x85xxx\xa0
  15774. /^\w+/tables=2
  15775. École
  15776. 0: \xc3
  15777. /^\w+/tables=3
  15778. ** 'Tables = 3' is invalid: binary tables have not been loaded
  15779. École
  15780. #loadtables ./testbtables
  15781. /^\w+/tables=3
  15782. École
  15783. 0: \xc3
  15784. /"(*MARK:>" 00 "<).."/hex,mark,no_start_optimize
  15785. AB
  15786. 0: AB
  15787. MK: >\x00<
  15788. A\=ph
  15789. Partial match, mark=>\x00<: A
  15790. \= Expect no match
  15791. A
  15792. No match, mark = >\x00<
  15793. /"(*MARK:>" 00 "<).(?C1)."/hex,mark,no_start_optimize
  15794. AB
  15795. --->AB
  15796. 1 ^^ .
  15797. Latest Mark: >\x00<
  15798. 0: AB
  15799. MK: >\x00<
  15800. /(?(VERSION=0.0/
  15801. Failed: error 179 at offset 14: syntax error or number too big in (?(VERSION condition
  15802. # Perl has made \K in lookarounds an error. PCRE2 now rejects as well, unless
  15803. # explicitly authorized.
  15804. /(?=a\Kb)ab/
  15805. Failed: error 199 at offset 10: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15806. /(?=a\Kb)ab/allow_lookaround_bsk
  15807. ab
  15808. 0: b
  15809. /(?!a\Kb)ac/
  15810. Failed: error 199 at offset 10: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15811. /(?!a\Kb)ac/allow_lookaround_bsk
  15812. ac
  15813. 0: ac
  15814. /^abc(?<=b\Kc)d/
  15815. Failed: error 199 at offset 14: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15816. /^abc(?<=b\Kc)d/allow_lookaround_bsk
  15817. abcd
  15818. 0: cd
  15819. /^abc(?<!b\Kq)d/
  15820. Failed: error 199 at offset 14: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15821. /^abc(?<!b\Kq)d/,allow_lookaround_bsk
  15822. abcd
  15823. 0: abcd
  15824. # ---------
  15825. # Tests for zero-length NULL to be treated as an empty string.
  15826. //
  15827. \=null_subject
  15828. 0:
  15829. \= Expect error
  15830. abc\=null_subject
  15831. Failed: error -51: NULL argument passed with non-zero length
  15832. //replace=[20]
  15833. abc\=null_replacement
  15834. 1: abc
  15835. \=null_subject
  15836. 1:
  15837. \=null_replacement
  15838. 1:
  15839. /X*/g,replace=xy
  15840. \= Expect error
  15841. >X<\=null_replacement
  15842. Failed: error -51: NULL argument passed with non-zero length
  15843. /X+/replace=[20]
  15844. >XX<\=null_replacement
  15845. 1: ><
  15846. # ---------
  15847. /[Aa]{2}/BI
  15848. ------------------------------------------------------------------
  15849. Bra
  15850. /i A{2}
  15851. Ket
  15852. End
  15853. ------------------------------------------------------------------
  15854. Capture group count = 0
  15855. First code unit = 'A' (caseless)
  15856. Last code unit = 'A' (caseless)
  15857. Subject length lower bound = 2
  15858. aabcd
  15859. 0: aa
  15860. /A{2}/iBI
  15861. ------------------------------------------------------------------
  15862. Bra
  15863. /i A{2}
  15864. Ket
  15865. End
  15866. ------------------------------------------------------------------
  15867. Capture group count = 0
  15868. Options: caseless
  15869. First code unit = 'A' (caseless)
  15870. Last code unit = 'A' (caseless)
  15871. Subject length lower bound = 2
  15872. aabcd
  15873. 0: aa
  15874. /[Aa]{2,3}/BI
  15875. ------------------------------------------------------------------
  15876. Bra
  15877. /i A{2}
  15878. /i A?+
  15879. Ket
  15880. End
  15881. ------------------------------------------------------------------
  15882. Capture group count = 0
  15883. First code unit = 'A' (caseless)
  15884. Last code unit = 'A' (caseless)
  15885. Subject length lower bound = 2
  15886. aabcd
  15887. 0: aa
  15888. --
  15889. \[X]{-10}
  15890. ** Zero or negative repeat not allowed
  15891. # Check imposition of maximum by match_data_create().
  15892. /abcd/
  15893. abcd\=ovector=65536
  15894. 0: abcd
  15895. # Use recurse to test \K and Mark in atomic scope.
  15896. /(?>this line\s*((?R)|)\K)/
  15897. this line this line this line
  15898. 0:
  15899. 1: this line this line
  15900. /(?>this line\s*((?R)|)(*MARK:A))/
  15901. this line this line this line
  15902. 0: this line this line this line
  15903. 1: this line this line
  15904. # Check use of NULL pattern with zero length.
  15905. //null_pattern,use_length
  15906. abc
  15907. 0:
  15908. //null_pattern
  15909. Failed: error 116 at offset 0: pattern passed as NULL with non-zero length
  15910. /bad null pattern/null_pattern,use_length
  15911. Failed: error 116 at offset 0: pattern passed as NULL with non-zero length
  15912. /bad null pattern/null_pattern
  15913. Failed: error 116 at offset 0: pattern passed as NULL with non-zero length
  15914. # -------- Variable length lookbehinds --------
  15915. /12345(?<=\d{1,256})X/
  15916. Failed: error 200 at offset 5: branch too long in variable-length lookbehind assertion
  15917. /(?<=(\d{1,256}))X/max_varlookbehind=256
  15918. 12345XYZ
  15919. 0: X
  15920. 1: 12345
  15921. /12345(?<=a?bc)X/max_varlookbehind=0
  15922. Failed: error 200 at offset 5: branch too long in variable-length lookbehind assertion
  15923. /12345(?<=abc)X/max_varlookbehind=0
  15924. /(?<!( {65054}){9,44965})/
  15925. Failed: error 187 at offset 0: lookbehind assertion is too long
  15926. /(?(?<!|(|a)))/
  15927. aaaa\=get=0
  15928. 0:
  15929. 0G (0)
  15930. /(?(?<!|a?))/
  15931. aaaa\=get=0
  15932. 0:
  15933. 0G (0)
  15934. # --------
  15935. /(?<=(()()()()()()()()()()()()()(()()()()(())()()()()(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()(()()()()()()()()()()()()()()()()()()()()()(())()()()()(()()()()()()()()()()()()()(()()()()()()()()()()()()()(()())))))))))/
  15936. /(?<!( {65054}){0,44965})/auto_callout
  15937. Failed: error 187 at offset 0: lookbehind assertion is too long
  15938. /A+{,3}/
  15939. Failed: error 109 at offset 5: quantifier does not follow a repeatable item
  15940. /(\g{+1}Z|(A))+/
  15941. BAAZCD
  15942. 0: AAZ
  15943. 1: AZ
  15944. 2: A
  15945. ZAAAZAZAZAACD
  15946. 0: AAAZAZAZAA
  15947. 1: A
  15948. 2: A
  15949. # This doesn't work in Perl (though I think it used to)
  15950. /^(?=.*(?=(([A-Z]).*(?(1)\1)))(?!.+\2)){26}/i
  15951. The quick brown fox jumps over the lazy dog.
  15952. 0:
  15953. 1: quick brown fox jumps over the lazy dog.
  15954. 2: q
  15955. Jackdaws love my big sphinx of quartz.
  15956. 0:
  15957. 1: Jackdaws love my big sphinx of quartz.
  15958. 2: J
  15959. Pack my box with five dozen liquor jugs.
  15960. 0:
  15961. 1: Pack my box with five dozen liquor jugs.
  15962. 2: P
  15963. \= Expect no match
  15964. The quick brown fox jumps over the lazy cat.
  15965. No match
  15966. Hackdaws love my big sphinx of quartz.
  15967. No match
  15968. Pack my fox with five dozen liquor jugs.
  15969. No match
  15970. # These are different to Perl because of the different capturing in repeating
  15971. # groups.
  15972. /((foo)|(bar))*/
  15973. foobar
  15974. 0: foobar
  15975. 1: bar
  15976. 2: foo
  15977. 3: bar
  15978. /(?:(f)(o)(o)|(b)(a)(r))*/
  15979. foobar
  15980. 0: foobar
  15981. 1: f
  15982. 2: o
  15983. 3: o
  15984. 4: b
  15985. 5: a
  15986. 6: r
  15987. /((Z)+|A)*/
  15988. ZABCDEFG
  15989. 0: ZA
  15990. 1: A
  15991. 2: Z
  15992. /(?:(?P=same)?(?:(?P<same>a)|(?P<same>b))(?P=same))+/g,dupnames
  15993. bbbaaabaabb
  15994. 0: bbbaaaba
  15995. 1: a
  15996. 2: b
  15997. 0: bb
  15998. 1: <unset>
  15999. 2: b
  16000. # --------
  16001. /
  16002. /anchored, firstline
  16003. \x0a
  16004. 0: \x0a
  16005. /
  16006. /anchored,firstline,no_start_optimize
  16007. \x0a
  16008. 0: \x0a
  16009. /
  16010. /firstline
  16011. \x0a
  16012. 0: \x0a
  16013. abc\x0adef
  16014. 0: \x0a
  16015. # This test is currently broken in the interpreter
  16016. # /|a(?0)/endanchored
  16017. # aaaa
  16018. /A +/extended
  16019. /(*ACCEPT)+/B,auto_callout
  16020. ------------------------------------------------------------------
  16021. Bra
  16022. Callout 255 0 10
  16023. SBra
  16024. *ACCEPT
  16025. KetRmax
  16026. Callout 255 10 0
  16027. Ket
  16028. End
  16029. ------------------------------------------------------------------
  16030. /a\z/
  16031. a
  16032. 0: a
  16033. a\=noteol
  16034. 0: a
  16035. # This matches a character that only exists once in the subject, sort of like a
  16036. # hypothetical "(.)(?<!\1.+)(?!.*\1)". That has unlimited variable length
  16037. # lookbehind, so is invalid. This pattern doesn't work in Perl 5.38.0.
  16038. /\G(?:(?=(\1.|)(.))){1,13}?(?!.*\2.*\2)\1\K\2/g
  16039. aaabcccdeee
  16040. 0: b
  16041. 1: aaa
  16042. 2: b
  16043. 0: d
  16044. 1: ccc
  16045. 2: d
  16046. /|(?0)./endanchored
  16047. abcd
  16048. 0: abcd
  16049. /|a(?0)/endanchored
  16050. aaaa
  16051. 0: aaaa
  16052. /(?:|(?0).)(?(R)|\z)/
  16053. abcd
  16054. 0: abcd
  16055. /a?(?=b(*COMMIT)c|)d/I
  16056. Capture group count = 0
  16057. Starting code units: a d
  16058. Last code unit = 'd'
  16059. Subject length lower bound = 1
  16060. bd
  16061. 0: d
  16062. /(?=b(*COMMIT)c|)d/I
  16063. Capture group count = 0
  16064. First code unit = 'd'
  16065. Subject length lower bound = 1
  16066. bd
  16067. 0: d
  16068. /a?(?=b(*COMMIT)c|)d/I,no_start_optimize
  16069. Capture group count = 0
  16070. Options: no_start_optimize
  16071. bd
  16072. No match
  16073. /(?=b(*COMMIT)c|)d/I,no_start_optimize
  16074. Capture group count = 0
  16075. Options: no_start_optimize
  16076. bd
  16077. No match
  16078. /a?(?=bc|)d/I,auto_callout
  16079. Capture group count = 0
  16080. Options: auto_callout
  16081. Starting code units: a d
  16082. Last code unit = 'd'
  16083. Subject length lower bound = 1
  16084. bd
  16085. --->bd
  16086. +0 ^ a?
  16087. +2 ^ (?=
  16088. +5 ^ b
  16089. +8 ^ )
  16090. +9 ^ d
  16091. +10 ^^ End of pattern
  16092. 0: d
  16093. /a?(?=bc|)\bd/I
  16094. Capture group count = 0
  16095. Max lookbehind = 1
  16096. Starting code units: a d
  16097. Last code unit = 'd'
  16098. Subject length lower bound = 1
  16099. bd
  16100. No match
  16101. /(?0)/
  16102. abc\=disable_recurseloop_check,match_limit=100
  16103. Failed: error -47: match limit exceeded
  16104. /(a(?1)z||(?1)++)$/
  16105. abcd\=disable_recurseloop_check
  16106. 0:
  16107. 1:
  16108. /(((?<=123?456456|ABC)))(?<=\2)../
  16109. ABCDEFG
  16110. 0: DE
  16111. 1:
  16112. 2:
  16113. 12345645678910
  16114. 0: 78
  16115. 1:
  16116. 2:
  16117. # This test is crashing Perl 5.38.2.
  16118. /[^\S\W]{6}/
  16119. .abc def..
  16120. No match
  16121. # End of testinput2
  16122. Error -70: PCRE2_ERROR_BADDATA (unknown error number)
  16123. Error -62: bad serialized data
  16124. Error -2: partial match
  16125. Error -1: no match
  16126. Error 0: PCRE2_ERROR_BADDATA (unknown error number)
  16127. Error 100: no error
  16128. Error 101: \ at end of pattern
  16129. Error 191: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode
  16130. Error 300: PCRE2_ERROR_BADDATA (unknown error number)