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.

5045 lines
89 KiB

  1. # This set of tests check the DFA matching functionality of pcre2_dfa_match(),
  2. # excluding UTF and Unicode property support. All matches are done using DFA,
  3. # forced by setting a default subject modifier at the start.
  4. #forbid_utf
  5. #subject dfa
  6. #newline_default lf anycrlf any
  7. /abc/
  8. abc
  9. /ab*c/
  10. abc
  11. abbbbc
  12. ac
  13. /ab+c/
  14. abc
  15. abbbbbbc
  16. \= Expect no match
  17. ac
  18. ab
  19. /a*/no_auto_possess
  20. a
  21. aaaaaaaaaaaaaaaaa
  22. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=10
  23. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=dfa_shortest
  24. /(a|abcd|african)/
  25. a
  26. abcd
  27. african
  28. /^abc/
  29. abcdef
  30. \= Expect no match
  31. xyzabc
  32. xyz\nabc
  33. /^abc/m
  34. abcdef
  35. xyz\nabc
  36. \= Expect no match
  37. xyzabc
  38. /\Aabc/
  39. abcdef
  40. \= Expect no match
  41. xyzabc
  42. xyz\nabc
  43. /\Aabc/m
  44. abcdef
  45. \= Expect no match
  46. xyzabc
  47. xyz\nabc
  48. /\Gabc/
  49. abcdef
  50. xyzabc\=offset=3
  51. \= Expect no match
  52. xyzabc
  53. xyzabc\=offset=2
  54. /x\dy\Dz/
  55. x9yzz
  56. x0y+z
  57. \= Expect no match
  58. xyz
  59. xxy0z
  60. /x\sy\Sz/
  61. x yzz
  62. x y+z
  63. \= Expect no match
  64. xyz
  65. xxyyz
  66. /x\wy\Wz/
  67. xxy+z
  68. \= Expect no match
  69. xxy0z
  70. x+y+z
  71. /x.y/
  72. x+y
  73. x-y
  74. \= Expect no match
  75. x\ny
  76. /x.y/s
  77. x+y
  78. x-y
  79. x\ny
  80. /(a.b(?s)c.d|x.y)p.q/
  81. a+bc+dp+q
  82. a+bc\ndp+q
  83. x\nyp+q
  84. \= Expect no match
  85. a\nbc\ndp+q
  86. a+bc\ndp\nq
  87. x\nyp\nq
  88. /a\d\z/
  89. ba0
  90. \= Expect no match
  91. ba0\n
  92. ba0\ncd
  93. /a\d\z/m
  94. ba0
  95. \= Expect no match
  96. ba0\n
  97. ba0\ncd
  98. /a\d\Z/
  99. ba0
  100. ba0\n
  101. \= Expect no match
  102. ba0\ncd
  103. /a\d\Z/m
  104. ba0
  105. ba0\n
  106. \= Expect no match
  107. ba0\ncd
  108. /a\d$/
  109. ba0
  110. ba0\n
  111. \= Expect no match
  112. ba0\ncd
  113. /a\d$/m
  114. ba0
  115. ba0\n
  116. ba0\ncd
  117. /abc/i
  118. abc
  119. aBc
  120. ABC
  121. /[^a]/
  122. abcd
  123. /ab?\w/
  124. abz
  125. abbz
  126. azz
  127. /x{0,3}yz/
  128. ayzq
  129. axyzq
  130. axxyz
  131. axxxyzq
  132. axxxxyzq
  133. \= Expect no match
  134. ax
  135. axx
  136. /x{3}yz/
  137. axxxyzq
  138. axxxxyzq
  139. \= Expect no match
  140. ax
  141. axx
  142. ayzq
  143. axyzq
  144. axxyz
  145. /x{2,3}yz/
  146. axxyz
  147. axxxyzq
  148. axxxxyzq
  149. \= Expect no match
  150. ax
  151. axx
  152. ayzq
  153. axyzq
  154. /[^a]+/no_auto_possess
  155. bac
  156. bcdefax
  157. \= Expect no match
  158. aaaaa
  159. /[^a]*/no_auto_possess
  160. bac
  161. bcdefax
  162. aaaaa
  163. /[^a]{3,5}/no_auto_possess
  164. xyz
  165. awxyza
  166. abcdefa
  167. abcdefghijk
  168. \= Expect no match
  169. axya
  170. axa
  171. aaaaa
  172. /\d*/
  173. 1234b567
  174. xyz
  175. /\D*/
  176. a1234b567
  177. xyz
  178. /\d+/
  179. ab1234c56
  180. \= Expect no match
  181. xyz
  182. /\D+/
  183. ab123c56
  184. \= Expect no match
  185. 789
  186. /\d?A/
  187. 045ABC
  188. ABC
  189. \= Expect no match
  190. XYZ
  191. /\D?A/
  192. ABC
  193. BAC
  194. 9ABC
  195. /a+/
  196. aaaa
  197. /^.*xyz/
  198. xyz
  199. ggggggggxyz
  200. /^.+xyz/
  201. abcdxyz
  202. axyz
  203. \= Expect no match
  204. xyz
  205. /^.?xyz/
  206. xyz
  207. cxyz
  208. /^\d{2,3}X/
  209. 12X
  210. 123X
  211. \= Expect no match
  212. X
  213. 1X
  214. 1234X
  215. /^[abcd]\d/
  216. a45
  217. b93
  218. c99z
  219. d04
  220. \= Expect no match
  221. e45
  222. abcd
  223. abcd1234
  224. 1234
  225. /^[abcd]*\d/
  226. a45
  227. b93
  228. c99z
  229. d04
  230. abcd1234
  231. 1234
  232. \= Expect no match
  233. e45
  234. abcd
  235. /^[abcd]+\d/
  236. a45
  237. b93
  238. c99z
  239. d04
  240. abcd1234
  241. \= Expect no match
  242. 1234
  243. e45
  244. abcd
  245. /^a+X/
  246. aX
  247. aaX
  248. /^[abcd]?\d/
  249. a45
  250. b93
  251. c99z
  252. d04
  253. 1234
  254. \= Expect no match
  255. abcd1234
  256. e45
  257. /^[abcd]{2,3}\d/
  258. ab45
  259. bcd93
  260. \= Expect no match
  261. 1234
  262. a36
  263. abcd1234
  264. ee45
  265. /^(abc)*\d/
  266. abc45
  267. abcabcabc45
  268. 42xyz
  269. /^(abc)+\d/
  270. abc45
  271. abcabcabc45
  272. \= Expect no match
  273. 42xyz
  274. /^(abc)?\d/
  275. abc45
  276. 42xyz
  277. \= Expect no match
  278. abcabcabc45
  279. /^(abc){2,3}\d/
  280. abcabc45
  281. abcabcabc45
  282. \= Expect no match
  283. abcabcabcabc45
  284. abc45
  285. 42xyz
  286. /1(abc|xyz)2(?1)3/
  287. 1abc2abc3456
  288. 1abc2xyz3456
  289. /^(a*\w|ab)=(a*\w|ab)/
  290. ab=ab
  291. /^(a*\w|ab)=(?1)/
  292. ab=ab
  293. /^([^()]|\((?1)*\))*$/
  294. abc
  295. a(b)c
  296. a(b(c))d
  297. \= Expect no match)
  298. a(b(c)d
  299. /^>abc>([^()]|\((?1)*\))*<xyz<$/
  300. >abc>123<xyz<
  301. >abc>1(2)3<xyz<
  302. >abc>(1(2)3)<xyz<
  303. /^(?>a*)\d/
  304. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
  305. \= Expect no match
  306. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  307. /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x
  308. <>
  309. <abcd>
  310. <abc <123> hij>
  311. <abc <def> hij>
  312. <abc<>def>
  313. <abc<>
  314. \= Expect no match
  315. <abc
  316. /^(?(?=abc)\w{3}:|\d\d)$/
  317. abc:
  318. 12
  319. \= Expect no match
  320. 123
  321. xyz
  322. /^(?(?!abc)\d\d|\w{3}:)$/
  323. abc:
  324. 12
  325. \= Expect no match
  326. 123
  327. xyz
  328. /^(?=abc)\w{5}:$/
  329. abcde:
  330. \= Expect no match
  331. abc..
  332. 123
  333. vwxyz
  334. /^(?!abc)\d\d$/
  335. 12
  336. \= Expect no match
  337. abcde:
  338. abc..
  339. 123
  340. vwxyz
  341. /(?<=abc|xy)123/
  342. abc12345
  343. wxy123z
  344. \= Expect no match
  345. 123abc
  346. /(?<!abc|xy)123/
  347. 123abc
  348. mno123456
  349. \= Expect no match
  350. abc12345
  351. wxy123z
  352. /abc(?C1)xyz/
  353. abcxyz
  354. 123abcxyz999
  355. /(ab|cd){3,4}/auto_callout
  356. ababab
  357. abcdabcd
  358. abcdcdcdcdcd
  359. /^abc/
  360. abcdef
  361. \= Expect no match
  362. abcdef\=notbol
  363. /^(a*|xyz)/
  364. bcd
  365. aaabcd
  366. xyz
  367. xyz\=notempty
  368. \= Expect no match
  369. bcd\=notempty
  370. /xyz$/
  371. xyz
  372. xyz\n
  373. \= Expect no match
  374. xyz\=noteol
  375. xyz\n\=noteol
  376. /xyz$/m
  377. xyz
  378. xyz\n
  379. abcxyz\npqr
  380. abcxyz\npqr\=noteol
  381. xyz\n\=noteol
  382. \= Expect no match
  383. xyz\=noteol
  384. /\Gabc/
  385. abcdef
  386. defabcxyz\=offset=3
  387. \= Expect no match
  388. defabcxyz
  389. /^abcdef/
  390. ab\=ps
  391. abcde\=ps
  392. abcdef\=ps
  393. \= Expect no match
  394. abx\=ps
  395. /^a{2,4}\d+z/
  396. a\=ps
  397. aa\=ps
  398. aa2\=ps
  399. aaa\=ps
  400. aaa23\=ps
  401. aaaa12345\=ps
  402. aa0z\=ps
  403. aaaa4444444444444z\=ps
  404. \= Expect no match
  405. az\=ps
  406. aaaaa\=ps
  407. a56\=ps
  408. /^abcdef/
  409. abc\=ps
  410. def\=dfa_restart
  411. /(?<=foo)bar/
  412. foob\=ps,offset=2,allusedtext
  413. foobar...\=ps,dfa_restart,offset=4
  414. foobar\=offset=2
  415. \= Expect no match
  416. xyzfo\=ps
  417. obar\=dfa_restart
  418. /(ab*(cd|ef))+X/
  419. lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\=ps,notbol,noteol
  420. cdabbbbbbbb\=ps,notbol,dfa_restart,noteol
  421. efabbbbbbbbbbbbbbbb\=ps,notbol,dfa_restart,noteol
  422. bbbbbbbbbbbbcdXyasdfadf\=ps,notbol,dfa_restart,noteol
  423. \= Expect no match
  424. adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
  425. /the quick brown fox/
  426. the quick brown fox
  427. What do you know about the quick brown fox?
  428. \= Expect no match
  429. The quick brown FOX
  430. What do you know about THE QUICK BROWN FOX?
  431. /The quick brown fox/i
  432. the quick brown fox
  433. The quick brown FOX
  434. What do you know about the quick brown fox?
  435. What do you know about THE QUICK BROWN FOX?
  436. /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
  437. abcd\t\n\r\f\a\e9;\$\\?caxyz
  438. /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
  439. abxyzpqrrrabbxyyyypqAzz
  440. abxyzpqrrrabbxyyyypqAzz
  441. aabxyzpqrrrabbxyyyypqAzz
  442. aaabxyzpqrrrabbxyyyypqAzz
  443. aaaabxyzpqrrrabbxyyyypqAzz
  444. abcxyzpqrrrabbxyyyypqAzz
  445. aabcxyzpqrrrabbxyyyypqAzz
  446. aaabcxyzpqrrrabbxyyyypAzz
  447. aaabcxyzpqrrrabbxyyyypqAzz
  448. aaabcxyzpqrrrabbxyyyypqqAzz
  449. aaabcxyzpqrrrabbxyyyypqqqAzz
  450. aaabcxyzpqrrrabbxyyyypqqqqAzz
  451. aaabcxyzpqrrrabbxyyyypqqqqqAzz
  452. aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  453. aaaabcxyzpqrrrabbxyyyypqAzz
  454. abxyzzpqrrrabbxyyyypqAzz
  455. aabxyzzzpqrrrabbxyyyypqAzz
  456. aaabxyzzzzpqrrrabbxyyyypqAzz
  457. aaaabxyzzzzpqrrrabbxyyyypqAzz
  458. abcxyzzpqrrrabbxyyyypqAzz
  459. aabcxyzzzpqrrrabbxyyyypqAzz
  460. aaabcxyzzzzpqrrrabbxyyyypqAzz
  461. aaaabcxyzzzzpqrrrabbxyyyypqAzz
  462. aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  463. aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  464. aaabcxyzpqrrrabbxyyyypABzz
  465. aaabcxyzpqrrrabbxyyyypABBzz
  466. >>>aaabxyzpqrrrabbxyyyypqAzz
  467. >aaaabxyzpqrrrabbxyyyypqAzz
  468. >>>>abcxyzpqrrrabbxyyyypqAzz
  469. \= Expect no match
  470. abxyzpqrrabbxyyyypqAzz
  471. abxyzpqrrrrabbxyyyypqAzz
  472. abxyzpqrrrabxyyyypqAzz
  473. aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
  474. aaaabcxyzzzzpqrrrabbbxyyypqAzz
  475. aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
  476. /^(abc){1,2}zz/
  477. abczz
  478. abcabczz
  479. \= Expect no match
  480. zz
  481. abcabcabczz
  482. >>abczz
  483. /^(b+?|a){1,2}?c/
  484. bc
  485. bbc
  486. bbbc
  487. bac
  488. bbac
  489. aac
  490. abbbbbbbbbbbc
  491. bbbbbbbbbbbac
  492. \= Expect no match
  493. aaac
  494. abbbbbbbbbbbac
  495. /^(b+|a){1,2}c/
  496. bc
  497. bbc
  498. bbbc
  499. bac
  500. bbac
  501. aac
  502. abbbbbbbbbbbc
  503. bbbbbbbbbbbac
  504. \= Expect no match
  505. aaac
  506. abbbbbbbbbbbac
  507. /^(b+|a){1,2}?bc/
  508. bbc
  509. /^(b*|ba){1,2}?bc/
  510. babc
  511. bbabc
  512. bababc
  513. \= Expect no match
  514. bababbc
  515. babababc
  516. /^(ba|b*){1,2}?bc/
  517. babc
  518. bbabc
  519. bababc
  520. \= Expect no match
  521. bababbc
  522. babababc
  523. /^\ca\cA\c[\c{\c:/
  524. \x01\x01\e;z
  525. /^[ab\]cde]/
  526. athing
  527. bthing
  528. ]thing
  529. cthing
  530. dthing
  531. ething
  532. \= Expect no match
  533. fthing
  534. [thing
  535. \\thing
  536. /^[]cde]/
  537. ]thing
  538. cthing
  539. dthing
  540. ething
  541. \= Expect no match
  542. athing
  543. fthing
  544. /^[^ab\]cde]/
  545. fthing
  546. [thing
  547. \\thing
  548. \= Expect no match
  549. athing
  550. bthing
  551. ]thing
  552. cthing
  553. dthing
  554. ething
  555. /^[^]cde]/
  556. athing
  557. fthing
  558. \= Expect no match
  559. ]thing
  560. cthing
  561. dthing
  562. ething
  563. /^\�/
  564. /^�/
  565. /^[0-9]+$/
  566. 0
  567. 1
  568. 2
  569. 3
  570. 4
  571. 5
  572. 6
  573. 7
  574. 8
  575. 9
  576. 10
  577. 100
  578. \= Expect no match
  579. abc
  580. /^.*nter/
  581. enter
  582. inter
  583. uponter
  584. /^xxx[0-9]+$/
  585. xxx0
  586. xxx1234
  587. \= Expect no match
  588. xxx
  589. /^.+[0-9][0-9][0-9]$/
  590. x123
  591. xx123
  592. 123456
  593. x1234
  594. \= Expect no match
  595. 123
  596. /^.+?[0-9][0-9][0-9]$/
  597. x123
  598. xx123
  599. 123456
  600. x1234
  601. \= Expect no match
  602. 123
  603. /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
  604. abc!pqr=apquxz.ixr.zzz.ac.uk
  605. \= Expect no match
  606. !pqr=apquxz.ixr.zzz.ac.uk
  607. abc!=apquxz.ixr.zzz.ac.uk
  608. abc!pqr=apquxz:ixr.zzz.ac.uk
  609. abc!pqr=apquxz.ixr.zzz.ac.ukk
  610. /:/
  611. Well, we need a colon: somewhere
  612. \= Expect no match
  613. No match without a colon
  614. /([\da-f:]+)$/i
  615. 0abc
  616. abc
  617. fed
  618. E
  619. ::
  620. 5f03:12C0::932e
  621. fed def
  622. Any old stuff
  623. \= Expect no match
  624. 0zzz
  625. gzzz
  626. fed\x20
  627. Any old rubbish
  628. /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
  629. .1.2.3
  630. A.12.123.0
  631. \= Expect no match
  632. .1.2.3333
  633. 1.2.3
  634. 1234.2.3
  635. /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  636. 1 IN SOA non-sp1 non-sp2(
  637. 1 IN SOA non-sp1 non-sp2 (
  638. \= Expect no match
  639. 1IN SOA non-sp1 non-sp2(
  640. /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
  641. a.
  642. Z.
  643. 2.
  644. ab-c.pq-r.
  645. sxk.zzz.ac.uk.
  646. x-.y-.
  647. \= Expect no match
  648. -abc.peq.
  649. /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
  650. *.a
  651. *.b0-a
  652. *.c3-b.c
  653. *.c-a.b-c
  654. \= Expect no match
  655. *.0
  656. *.a-
  657. *.a-b.c-
  658. *.c-a.0-c
  659. /^(?=ab(de))(abd)(e)/
  660. abde
  661. /^(?!(ab)de|x)(abd)(f)/
  662. abdf
  663. /^(?=(ab(cd)))(ab)/
  664. abcd
  665. /^[\da-f](\.[\da-f])*$/i
  666. a.b.c.d
  667. A.B.C.D
  668. a.b.c.1.2.3.C
  669. /^\".*\"\s*(;.*)?$/
  670. \"1234\"
  671. \"abcd\" ;
  672. \"\" ; rhubarb
  673. \= Expect no match
  674. \"1234\" : things
  675. /^$/
  676. \
  677. / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
  678. ab c
  679. \= Expect no match
  680. abc
  681. ab cde
  682. /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
  683. ab c
  684. \= Expect no match
  685. abc
  686. ab cde
  687. /^ a\ b[c ]d $/x
  688. a bcd
  689. a b d
  690. \= Expect no match
  691. abcd
  692. ab d
  693. /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
  694. abcdefhijklm
  695. /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
  696. abcdefhijklm
  697. /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
  698. a+ Z0+\x08\n\x1d\x12
  699. /^[.^$|()*+?{,}]+/
  700. .^\$(*+)|{?,?}
  701. /^a*\w/
  702. z
  703. az
  704. aaaz
  705. a
  706. aa
  707. aaaa
  708. a+
  709. aa+
  710. /^a*?\w/
  711. z
  712. az
  713. aaaz
  714. a
  715. aa
  716. aaaa
  717. a+
  718. aa+
  719. /^a+\w/
  720. az
  721. aaaz
  722. aa
  723. aaaa
  724. aa+
  725. /^a+?\w/
  726. az
  727. aaaz
  728. aa
  729. aaaa
  730. aa+
  731. /^\d{8}\w{2,}/
  732. 1234567890
  733. 12345678ab
  734. 12345678__
  735. \= Expect no match
  736. 1234567
  737. /^[aeiou\d]{4,5}$/
  738. uoie
  739. 1234
  740. 12345
  741. aaaaa
  742. \= Expect no match
  743. 123456
  744. /^[aeiou\d]{4,5}?/
  745. uoie
  746. 1234
  747. 12345
  748. aaaaa
  749. 123456
  750. /^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]/
  751. From abcd Mon Sep 01 12:33:02 1997
  752. /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
  753. From abcd Mon Sep 01 12:33:02 1997
  754. From abcd Mon Sep 1 12:33:02 1997
  755. \= Expect no match
  756. From abcd Sep 01 12:33:02 1997
  757. /^12.34/s
  758. 12\n34
  759. 12\r34
  760. /\w+(?=\t)/
  761. the quick brown\t fox
  762. /foo(?!bar)(.*)/
  763. foobar is foolish see?
  764. /(?:(?!foo)...|^.{0,2})bar(.*)/
  765. foobar crowbar etc
  766. barrel
  767. 2barrel
  768. A barrel
  769. /^(\D*)(?=\d)(?!123)/
  770. abc456
  771. \= Expect no match
  772. abc123
  773. /^1234(?# test newlines
  774. inside)/
  775. 1234
  776. /^1234 #comment in extended re
  777. /x
  778. 1234
  779. /#rhubarb
  780. abcd/x
  781. abcd
  782. /^abcd#rhubarb/x
  783. abcd
  784. /(?!^)abc/
  785. the abc
  786. \= Expect no match
  787. abc
  788. /(?=^)abc/
  789. abc
  790. \= Expect no match
  791. the abc
  792. /^[ab]{1,3}(ab*|b)/no_auto_possess
  793. aabbbbb
  794. /^[ab]{1,3}?(ab*|b)/no_auto_possess
  795. aabbbbb
  796. /^[ab]{1,3}?(ab*?|b)/no_auto_possess
  797. aabbbbb
  798. /^[ab]{1,3}(ab*?|b)/no_auto_possess
  799. aabbbbb
  800. / (?: [\040\t] | \(
  801. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  802. \) )* # optional leading comment
  803. (?: (?:
  804. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  805. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  806. |
  807. " (?: # opening quote...
  808. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  809. | # or
  810. \\ [^\x80-\xff] # Escaped something (something != CR)
  811. )* " # closing quote
  812. ) # initial word
  813. (?: (?: [\040\t] | \(
  814. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  815. \) )* \. (?: [\040\t] | \(
  816. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  817. \) )* (?:
  818. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  819. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  820. |
  821. " (?: # opening quote...
  822. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  823. | # or
  824. \\ [^\x80-\xff] # Escaped something (something != CR)
  825. )* " # closing quote
  826. ) )* # further okay, if led by a period
  827. (?: [\040\t] | \(
  828. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  829. \) )* @ (?: [\040\t] | \(
  830. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  831. \) )* (?:
  832. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  833. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  834. | \[ # [
  835. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  836. \] # ]
  837. ) # initial subdomain
  838. (?: #
  839. (?: [\040\t] | \(
  840. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  841. \) )* \. # if led by a period...
  842. (?: [\040\t] | \(
  843. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  844. \) )* (?:
  845. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  846. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  847. | \[ # [
  848. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  849. \] # ]
  850. ) # ...further okay
  851. )*
  852. # address
  853. | # or
  854. (?:
  855. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  856. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  857. |
  858. " (?: # opening quote...
  859. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  860. | # or
  861. \\ [^\x80-\xff] # Escaped something (something != CR)
  862. )* " # closing quote
  863. ) # one word, optionally followed by....
  864. (?:
  865. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  866. \(
  867. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  868. \) | # comments, or...
  869. " (?: # opening quote...
  870. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  871. | # or
  872. \\ [^\x80-\xff] # Escaped something (something != CR)
  873. )* " # closing quote
  874. # quoted strings
  875. )*
  876. < (?: [\040\t] | \(
  877. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  878. \) )* # leading <
  879. (?: @ (?: [\040\t] | \(
  880. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  881. \) )* (?:
  882. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  883. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  884. | \[ # [
  885. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  886. \] # ]
  887. ) # initial subdomain
  888. (?: #
  889. (?: [\040\t] | \(
  890. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  891. \) )* \. # if led by a period...
  892. (?: [\040\t] | \(
  893. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  894. \) )* (?:
  895. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  896. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  897. | \[ # [
  898. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  899. \] # ]
  900. ) # ...further okay
  901. )*
  902. (?: (?: [\040\t] | \(
  903. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  904. \) )* , (?: [\040\t] | \(
  905. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  906. \) )* @ (?: [\040\t] | \(
  907. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  908. \) )* (?:
  909. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  910. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  911. | \[ # [
  912. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  913. \] # ]
  914. ) # initial subdomain
  915. (?: #
  916. (?: [\040\t] | \(
  917. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  918. \) )* \. # if led by a period...
  919. (?: [\040\t] | \(
  920. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  921. \) )* (?:
  922. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  923. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  924. | \[ # [
  925. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  926. \] # ]
  927. ) # ...further okay
  928. )*
  929. )* # further okay, if led by comma
  930. : # closing colon
  931. (?: [\040\t] | \(
  932. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  933. \) )* )? # optional route
  934. (?:
  935. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  936. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  937. |
  938. " (?: # opening quote...
  939. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  940. | # or
  941. \\ [^\x80-\xff] # Escaped something (something != CR)
  942. )* " # closing quote
  943. ) # initial word
  944. (?: (?: [\040\t] | \(
  945. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  946. \) )* \. (?: [\040\t] | \(
  947. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  948. \) )* (?:
  949. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  950. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  951. |
  952. " (?: # opening quote...
  953. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  954. | # or
  955. \\ [^\x80-\xff] # Escaped something (something != CR)
  956. )* " # closing quote
  957. ) )* # further okay, if led by a period
  958. (?: [\040\t] | \(
  959. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  960. \) )* @ (?: [\040\t] | \(
  961. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  962. \) )* (?:
  963. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  964. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  965. | \[ # [
  966. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  967. \] # ]
  968. ) # initial subdomain
  969. (?: #
  970. (?: [\040\t] | \(
  971. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  972. \) )* \. # if led by a period...
  973. (?: [\040\t] | \(
  974. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  975. \) )* (?:
  976. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  977. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  978. | \[ # [
  979. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  980. \] # ]
  981. ) # ...further okay
  982. )*
  983. # address spec
  984. (?: [\040\t] | \(
  985. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  986. \) )* > # trailing >
  987. # name and address
  988. ) (?: [\040\t] | \(
  989. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  990. \) )* # optional trailing comment
  991. /x
  992. Alan Other <user\@dom.ain>
  993. <user\@dom.ain>
  994. user\@dom.ain
  995. \"A. Other\" <user.1234\@dom.ain> (a comment)
  996. A. Other <user.1234\@dom.ain> (a comment)
  997. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  998. A missing angle <user\@some.where
  999. \= Expect no match
  1000. The quick brown fox
  1001. /[\040\t]* # Nab whitespace.
  1002. (?:
  1003. \( # (
  1004. [^\\\x80-\xff\n\015()] * # normal*
  1005. (?: # (
  1006. (?: \\ [^\x80-\xff] |
  1007. \( # (
  1008. [^\\\x80-\xff\n\015()] * # normal*
  1009. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1010. \) # )
  1011. ) # special
  1012. [^\\\x80-\xff\n\015()] * # normal*
  1013. )* # )*
  1014. \) # )
  1015. [\040\t]* )* # If comment found, allow more spaces.
  1016. # optional leading comment
  1017. (?:
  1018. (?:
  1019. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1020. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1021. # Atom
  1022. | # or
  1023. " # "
  1024. [^\\\x80-\xff\n\015"] * # normal
  1025. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1026. " # "
  1027. # Quoted string
  1028. )
  1029. [\040\t]* # Nab whitespace.
  1030. (?:
  1031. \( # (
  1032. [^\\\x80-\xff\n\015()] * # normal*
  1033. (?: # (
  1034. (?: \\ [^\x80-\xff] |
  1035. \( # (
  1036. [^\\\x80-\xff\n\015()] * # normal*
  1037. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1038. \) # )
  1039. ) # special
  1040. [^\\\x80-\xff\n\015()] * # normal*
  1041. )* # )*
  1042. \) # )
  1043. [\040\t]* )* # If comment found, allow more spaces.
  1044. (?:
  1045. \.
  1046. [\040\t]* # Nab whitespace.
  1047. (?:
  1048. \( # (
  1049. [^\\\x80-\xff\n\015()] * # normal*
  1050. (?: # (
  1051. (?: \\ [^\x80-\xff] |
  1052. \( # (
  1053. [^\\\x80-\xff\n\015()] * # normal*
  1054. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1055. \) # )
  1056. ) # special
  1057. [^\\\x80-\xff\n\015()] * # normal*
  1058. )* # )*
  1059. \) # )
  1060. [\040\t]* )* # If comment found, allow more spaces.
  1061. (?:
  1062. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1063. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1064. # Atom
  1065. | # or
  1066. " # "
  1067. [^\\\x80-\xff\n\015"] * # normal
  1068. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1069. " # "
  1070. # Quoted string
  1071. )
  1072. [\040\t]* # Nab whitespace.
  1073. (?:
  1074. \( # (
  1075. [^\\\x80-\xff\n\015()] * # normal*
  1076. (?: # (
  1077. (?: \\ [^\x80-\xff] |
  1078. \( # (
  1079. [^\\\x80-\xff\n\015()] * # normal*
  1080. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1081. \) # )
  1082. ) # special
  1083. [^\\\x80-\xff\n\015()] * # normal*
  1084. )* # )*
  1085. \) # )
  1086. [\040\t]* )* # If comment found, allow more spaces.
  1087. # additional words
  1088. )*
  1089. @
  1090. [\040\t]* # Nab whitespace.
  1091. (?:
  1092. \( # (
  1093. [^\\\x80-\xff\n\015()] * # normal*
  1094. (?: # (
  1095. (?: \\ [^\x80-\xff] |
  1096. \( # (
  1097. [^\\\x80-\xff\n\015()] * # normal*
  1098. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1099. \) # )
  1100. ) # special
  1101. [^\\\x80-\xff\n\015()] * # normal*
  1102. )* # )*
  1103. \) # )
  1104. [\040\t]* )* # If comment found, allow more spaces.
  1105. (?:
  1106. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1107. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1108. |
  1109. \[ # [
  1110. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1111. \] # ]
  1112. )
  1113. [\040\t]* # Nab whitespace.
  1114. (?:
  1115. \( # (
  1116. [^\\\x80-\xff\n\015()] * # normal*
  1117. (?: # (
  1118. (?: \\ [^\x80-\xff] |
  1119. \( # (
  1120. [^\\\x80-\xff\n\015()] * # normal*
  1121. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1122. \) # )
  1123. ) # special
  1124. [^\\\x80-\xff\n\015()] * # normal*
  1125. )* # )*
  1126. \) # )
  1127. [\040\t]* )* # If comment found, allow more spaces.
  1128. # optional trailing comments
  1129. (?:
  1130. \.
  1131. [\040\t]* # Nab whitespace.
  1132. (?:
  1133. \( # (
  1134. [^\\\x80-\xff\n\015()] * # normal*
  1135. (?: # (
  1136. (?: \\ [^\x80-\xff] |
  1137. \( # (
  1138. [^\\\x80-\xff\n\015()] * # normal*
  1139. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1140. \) # )
  1141. ) # special
  1142. [^\\\x80-\xff\n\015()] * # normal*
  1143. )* # )*
  1144. \) # )
  1145. [\040\t]* )* # If comment found, allow more spaces.
  1146. (?:
  1147. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1148. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1149. |
  1150. \[ # [
  1151. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1152. \] # ]
  1153. )
  1154. [\040\t]* # Nab whitespace.
  1155. (?:
  1156. \( # (
  1157. [^\\\x80-\xff\n\015()] * # normal*
  1158. (?: # (
  1159. (?: \\ [^\x80-\xff] |
  1160. \( # (
  1161. [^\\\x80-\xff\n\015()] * # normal*
  1162. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1163. \) # )
  1164. ) # special
  1165. [^\\\x80-\xff\n\015()] * # normal*
  1166. )* # )*
  1167. \) # )
  1168. [\040\t]* )* # If comment found, allow more spaces.
  1169. # optional trailing comments
  1170. )*
  1171. # address
  1172. | # or
  1173. (?:
  1174. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1175. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1176. # Atom
  1177. | # or
  1178. " # "
  1179. [^\\\x80-\xff\n\015"] * # normal
  1180. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1181. " # "
  1182. # Quoted string
  1183. )
  1184. # leading word
  1185. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
  1186. (?:
  1187. (?:
  1188. \( # (
  1189. [^\\\x80-\xff\n\015()] * # normal*
  1190. (?: # (
  1191. (?: \\ [^\x80-\xff] |
  1192. \( # (
  1193. [^\\\x80-\xff\n\015()] * # normal*
  1194. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1195. \) # )
  1196. ) # special
  1197. [^\\\x80-\xff\n\015()] * # normal*
  1198. )* # )*
  1199. \) # )
  1200. |
  1201. " # "
  1202. [^\\\x80-\xff\n\015"] * # normal
  1203. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1204. " # "
  1205. ) # "special" comment or quoted string
  1206. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
  1207. )*
  1208. <
  1209. [\040\t]* # Nab whitespace.
  1210. (?:
  1211. \( # (
  1212. [^\\\x80-\xff\n\015()] * # normal*
  1213. (?: # (
  1214. (?: \\ [^\x80-\xff] |
  1215. \( # (
  1216. [^\\\x80-\xff\n\015()] * # normal*
  1217. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1218. \) # )
  1219. ) # special
  1220. [^\\\x80-\xff\n\015()] * # normal*
  1221. )* # )*
  1222. \) # )
  1223. [\040\t]* )* # If comment found, allow more spaces.
  1224. # <
  1225. (?:
  1226. @
  1227. [\040\t]* # Nab whitespace.
  1228. (?:
  1229. \( # (
  1230. [^\\\x80-\xff\n\015()] * # normal*
  1231. (?: # (
  1232. (?: \\ [^\x80-\xff] |
  1233. \( # (
  1234. [^\\\x80-\xff\n\015()] * # normal*
  1235. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1236. \) # )
  1237. ) # special
  1238. [^\\\x80-\xff\n\015()] * # normal*
  1239. )* # )*
  1240. \) # )
  1241. [\040\t]* )* # If comment found, allow more spaces.
  1242. (?:
  1243. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1244. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1245. |
  1246. \[ # [
  1247. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1248. \] # ]
  1249. )
  1250. [\040\t]* # Nab whitespace.
  1251. (?:
  1252. \( # (
  1253. [^\\\x80-\xff\n\015()] * # normal*
  1254. (?: # (
  1255. (?: \\ [^\x80-\xff] |
  1256. \( # (
  1257. [^\\\x80-\xff\n\015()] * # normal*
  1258. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1259. \) # )
  1260. ) # special
  1261. [^\\\x80-\xff\n\015()] * # normal*
  1262. )* # )*
  1263. \) # )
  1264. [\040\t]* )* # If comment found, allow more spaces.
  1265. # optional trailing comments
  1266. (?:
  1267. \.
  1268. [\040\t]* # Nab whitespace.
  1269. (?:
  1270. \( # (
  1271. [^\\\x80-\xff\n\015()] * # normal*
  1272. (?: # (
  1273. (?: \\ [^\x80-\xff] |
  1274. \( # (
  1275. [^\\\x80-\xff\n\015()] * # normal*
  1276. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1277. \) # )
  1278. ) # special
  1279. [^\\\x80-\xff\n\015()] * # normal*
  1280. )* # )*
  1281. \) # )
  1282. [\040\t]* )* # If comment found, allow more spaces.
  1283. (?:
  1284. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1285. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1286. |
  1287. \[ # [
  1288. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1289. \] # ]
  1290. )
  1291. [\040\t]* # Nab whitespace.
  1292. (?:
  1293. \( # (
  1294. [^\\\x80-\xff\n\015()] * # normal*
  1295. (?: # (
  1296. (?: \\ [^\x80-\xff] |
  1297. \( # (
  1298. [^\\\x80-\xff\n\015()] * # normal*
  1299. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1300. \) # )
  1301. ) # special
  1302. [^\\\x80-\xff\n\015()] * # normal*
  1303. )* # )*
  1304. \) # )
  1305. [\040\t]* )* # If comment found, allow more spaces.
  1306. # optional trailing comments
  1307. )*
  1308. (?: ,
  1309. [\040\t]* # Nab whitespace.
  1310. (?:
  1311. \( # (
  1312. [^\\\x80-\xff\n\015()] * # normal*
  1313. (?: # (
  1314. (?: \\ [^\x80-\xff] |
  1315. \( # (
  1316. [^\\\x80-\xff\n\015()] * # normal*
  1317. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1318. \) # )
  1319. ) # special
  1320. [^\\\x80-\xff\n\015()] * # normal*
  1321. )* # )*
  1322. \) # )
  1323. [\040\t]* )* # If comment found, allow more spaces.
  1324. @
  1325. [\040\t]* # Nab whitespace.
  1326. (?:
  1327. \( # (
  1328. [^\\\x80-\xff\n\015()] * # normal*
  1329. (?: # (
  1330. (?: \\ [^\x80-\xff] |
  1331. \( # (
  1332. [^\\\x80-\xff\n\015()] * # normal*
  1333. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1334. \) # )
  1335. ) # special
  1336. [^\\\x80-\xff\n\015()] * # normal*
  1337. )* # )*
  1338. \) # )
  1339. [\040\t]* )* # If comment found, allow more spaces.
  1340. (?:
  1341. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1342. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1343. |
  1344. \[ # [
  1345. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1346. \] # ]
  1347. )
  1348. [\040\t]* # Nab whitespace.
  1349. (?:
  1350. \( # (
  1351. [^\\\x80-\xff\n\015()] * # normal*
  1352. (?: # (
  1353. (?: \\ [^\x80-\xff] |
  1354. \( # (
  1355. [^\\\x80-\xff\n\015()] * # normal*
  1356. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1357. \) # )
  1358. ) # special
  1359. [^\\\x80-\xff\n\015()] * # normal*
  1360. )* # )*
  1361. \) # )
  1362. [\040\t]* )* # If comment found, allow more spaces.
  1363. # optional trailing comments
  1364. (?:
  1365. \.
  1366. [\040\t]* # Nab whitespace.
  1367. (?:
  1368. \( # (
  1369. [^\\\x80-\xff\n\015()] * # normal*
  1370. (?: # (
  1371. (?: \\ [^\x80-\xff] |
  1372. \( # (
  1373. [^\\\x80-\xff\n\015()] * # normal*
  1374. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1375. \) # )
  1376. ) # special
  1377. [^\\\x80-\xff\n\015()] * # normal*
  1378. )* # )*
  1379. \) # )
  1380. [\040\t]* )* # If comment found, allow more spaces.
  1381. (?:
  1382. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1383. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1384. |
  1385. \[ # [
  1386. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1387. \] # ]
  1388. )
  1389. [\040\t]* # Nab whitespace.
  1390. (?:
  1391. \( # (
  1392. [^\\\x80-\xff\n\015()] * # normal*
  1393. (?: # (
  1394. (?: \\ [^\x80-\xff] |
  1395. \( # (
  1396. [^\\\x80-\xff\n\015()] * # normal*
  1397. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1398. \) # )
  1399. ) # special
  1400. [^\\\x80-\xff\n\015()] * # normal*
  1401. )* # )*
  1402. \) # )
  1403. [\040\t]* )* # If comment found, allow more spaces.
  1404. # optional trailing comments
  1405. )*
  1406. )* # additional domains
  1407. :
  1408. [\040\t]* # Nab whitespace.
  1409. (?:
  1410. \( # (
  1411. [^\\\x80-\xff\n\015()] * # normal*
  1412. (?: # (
  1413. (?: \\ [^\x80-\xff] |
  1414. \( # (
  1415. [^\\\x80-\xff\n\015()] * # normal*
  1416. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1417. \) # )
  1418. ) # special
  1419. [^\\\x80-\xff\n\015()] * # normal*
  1420. )* # )*
  1421. \) # )
  1422. [\040\t]* )* # If comment found, allow more spaces.
  1423. # optional trailing comments
  1424. )? # optional route
  1425. (?:
  1426. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1427. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1428. # Atom
  1429. | # or
  1430. " # "
  1431. [^\\\x80-\xff\n\015"] * # normal
  1432. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1433. " # "
  1434. # Quoted string
  1435. )
  1436. [\040\t]* # Nab whitespace.
  1437. (?:
  1438. \( # (
  1439. [^\\\x80-\xff\n\015()] * # normal*
  1440. (?: # (
  1441. (?: \\ [^\x80-\xff] |
  1442. \( # (
  1443. [^\\\x80-\xff\n\015()] * # normal*
  1444. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1445. \) # )
  1446. ) # special
  1447. [^\\\x80-\xff\n\015()] * # normal*
  1448. )* # )*
  1449. \) # )
  1450. [\040\t]* )* # If comment found, allow more spaces.
  1451. (?:
  1452. \.
  1453. [\040\t]* # Nab whitespace.
  1454. (?:
  1455. \( # (
  1456. [^\\\x80-\xff\n\015()] * # normal*
  1457. (?: # (
  1458. (?: \\ [^\x80-\xff] |
  1459. \( # (
  1460. [^\\\x80-\xff\n\015()] * # normal*
  1461. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1462. \) # )
  1463. ) # special
  1464. [^\\\x80-\xff\n\015()] * # normal*
  1465. )* # )*
  1466. \) # )
  1467. [\040\t]* )* # If comment found, allow more spaces.
  1468. (?:
  1469. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1470. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1471. # Atom
  1472. | # or
  1473. " # "
  1474. [^\\\x80-\xff\n\015"] * # normal
  1475. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1476. " # "
  1477. # Quoted string
  1478. )
  1479. [\040\t]* # Nab whitespace.
  1480. (?:
  1481. \( # (
  1482. [^\\\x80-\xff\n\015()] * # normal*
  1483. (?: # (
  1484. (?: \\ [^\x80-\xff] |
  1485. \( # (
  1486. [^\\\x80-\xff\n\015()] * # normal*
  1487. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1488. \) # )
  1489. ) # special
  1490. [^\\\x80-\xff\n\015()] * # normal*
  1491. )* # )*
  1492. \) # )
  1493. [\040\t]* )* # If comment found, allow more spaces.
  1494. # additional words
  1495. )*
  1496. @
  1497. [\040\t]* # Nab whitespace.
  1498. (?:
  1499. \( # (
  1500. [^\\\x80-\xff\n\015()] * # normal*
  1501. (?: # (
  1502. (?: \\ [^\x80-\xff] |
  1503. \( # (
  1504. [^\\\x80-\xff\n\015()] * # normal*
  1505. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1506. \) # )
  1507. ) # special
  1508. [^\\\x80-\xff\n\015()] * # normal*
  1509. )* # )*
  1510. \) # )
  1511. [\040\t]* )* # If comment found, allow more spaces.
  1512. (?:
  1513. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1514. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1515. |
  1516. \[ # [
  1517. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1518. \] # ]
  1519. )
  1520. [\040\t]* # Nab whitespace.
  1521. (?:
  1522. \( # (
  1523. [^\\\x80-\xff\n\015()] * # normal*
  1524. (?: # (
  1525. (?: \\ [^\x80-\xff] |
  1526. \( # (
  1527. [^\\\x80-\xff\n\015()] * # normal*
  1528. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1529. \) # )
  1530. ) # special
  1531. [^\\\x80-\xff\n\015()] * # normal*
  1532. )* # )*
  1533. \) # )
  1534. [\040\t]* )* # If comment found, allow more spaces.
  1535. # optional trailing comments
  1536. (?:
  1537. \.
  1538. [\040\t]* # Nab whitespace.
  1539. (?:
  1540. \( # (
  1541. [^\\\x80-\xff\n\015()] * # normal*
  1542. (?: # (
  1543. (?: \\ [^\x80-\xff] |
  1544. \( # (
  1545. [^\\\x80-\xff\n\015()] * # normal*
  1546. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1547. \) # )
  1548. ) # special
  1549. [^\\\x80-\xff\n\015()] * # normal*
  1550. )* # )*
  1551. \) # )
  1552. [\040\t]* )* # If comment found, allow more spaces.
  1553. (?:
  1554. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1555. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1556. |
  1557. \[ # [
  1558. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1559. \] # ]
  1560. )
  1561. [\040\t]* # Nab whitespace.
  1562. (?:
  1563. \( # (
  1564. [^\\\x80-\xff\n\015()] * # normal*
  1565. (?: # (
  1566. (?: \\ [^\x80-\xff] |
  1567. \( # (
  1568. [^\\\x80-\xff\n\015()] * # normal*
  1569. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1570. \) # )
  1571. ) # special
  1572. [^\\\x80-\xff\n\015()] * # normal*
  1573. )* # )*
  1574. \) # )
  1575. [\040\t]* )* # If comment found, allow more spaces.
  1576. # optional trailing comments
  1577. )*
  1578. # address spec
  1579. > # >
  1580. # name and address
  1581. )
  1582. /x
  1583. Alan Other <user\@dom.ain>
  1584. <user\@dom.ain>
  1585. user\@dom.ain
  1586. \"A. Other\" <user.1234\@dom.ain> (a comment)
  1587. A. Other <user.1234\@dom.ain> (a comment)
  1588. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  1589. A missing angle <user\@some.where
  1590. \= Expect no match
  1591. The quick brown fox
  1592. /abc\0def\00pqr\000xyz\0000AB/
  1593. abc\0def\00pqr\000xyz\0000AB
  1594. abc456 abc\0def\00pqr\000xyz\0000ABCDE
  1595. /abc\x0def\x00pqr\x000xyz\x0000AB/
  1596. abc\x0def\x00pqr\x000xyz\x0000AB
  1597. abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
  1598. /^[\000-\037]/
  1599. \0A
  1600. \01B
  1601. \037C
  1602. /\0*/
  1603. \0\0\0\0
  1604. /A\x0{2,3}Z/
  1605. The A\x0\x0Z
  1606. An A\0\x0\0Z
  1607. \= Expect no match
  1608. A\0Z
  1609. A\0\x0\0\x0Z
  1610. /^\s/
  1611. \040abc
  1612. \x0cabc
  1613. \nabc
  1614. \rabc
  1615. \tabc
  1616. \= Expect no match
  1617. abc
  1618. /^a b
  1619. c/x
  1620. abc
  1621. /ab{1,3}bc/
  1622. abbbbc
  1623. abbbc
  1624. abbc
  1625. \= Expect no match
  1626. abc
  1627. abbbbbc
  1628. /([^.]*)\.([^:]*):[T ]+(.*)/
  1629. track1.title:TBlah blah blah
  1630. /([^.]*)\.([^:]*):[T ]+(.*)/i
  1631. track1.title:TBlah blah blah
  1632. /([^.]*)\.([^:]*):[t ]+(.*)/i
  1633. track1.title:TBlah blah blah
  1634. /^[W-c]+$/
  1635. WXY_^abc
  1636. \= Expect no match
  1637. wxy
  1638. /^[W-c]+$/i
  1639. WXY_^abc
  1640. wxy_^ABC
  1641. /^[\x3f-\x5F]+$/i
  1642. WXY_^abc
  1643. wxy_^ABC
  1644. /^abc$/m
  1645. abc
  1646. qqq\nabc
  1647. abc\nzzz
  1648. qqq\nabc\nzzz
  1649. /^abc$/
  1650. abc
  1651. \= Expect no match
  1652. qqq\nabc
  1653. abc\nzzz
  1654. qqq\nabc\nzzz
  1655. /\Aabc\Z/m
  1656. abc
  1657. abc\n
  1658. \= Expect no match
  1659. qqq\nabc
  1660. abc\nzzz
  1661. qqq\nabc\nzzz
  1662. /\A(.)*\Z/s
  1663. abc\ndef
  1664. /\A(.)*\Z/m
  1665. \= Expect no match
  1666. abc\ndef
  1667. /(?:b)|(?::+)/
  1668. b::c
  1669. c::b
  1670. /[-az]+/
  1671. az-
  1672. \= Expect no match
  1673. b
  1674. /[az-]+/
  1675. za-
  1676. \= Expect no match
  1677. b
  1678. /[a\-z]+/
  1679. a-z
  1680. \= Expect no match
  1681. b
  1682. /[a-z]+/
  1683. abcdxyz
  1684. /[\d-]+/
  1685. 12-34
  1686. \= Expect no match
  1687. aaa
  1688. /\x5c/
  1689. \\
  1690. /\x20Z/
  1691. the Zoo
  1692. \= Expect no match
  1693. Zulu
  1694. /ab{3cd/
  1695. ab{3cd
  1696. /ab{3,cd/
  1697. ab{3,cd
  1698. /ab{3,4a}cd/
  1699. ab{3,4a}cd
  1700. /{4,5a}bc/
  1701. {4,5a}bc
  1702. /^a.b/newline=lf
  1703. a\rb
  1704. \= Expect no match
  1705. a\nb
  1706. /abc$/
  1707. abc
  1708. abc\n
  1709. \= Expect no match
  1710. abc\ndef
  1711. /(abc)\123/
  1712. abc\x53
  1713. /(abc)\223/
  1714. abc\x93
  1715. /(abc)\323/
  1716. abc\xd3
  1717. /(abc)\100/
  1718. abc\x40
  1719. abc\100
  1720. /(abc)\1000/
  1721. abc\x400
  1722. abc\x40\x30
  1723. abc\1000
  1724. abc\100\x30
  1725. abc\100\060
  1726. abc\100\60
  1727. /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
  1728. abcdefghijk\12S
  1729. /a{0}bc/
  1730. bc
  1731. /(a|(bc)){0,0}?xyz/
  1732. xyz
  1733. /abc[\10]de/
  1734. abc\010de
  1735. /abc[\1]de/
  1736. abc\1de
  1737. /(abc)[\1]de/
  1738. abc\1de
  1739. /(?s)a.b/
  1740. a\nb
  1741. /^([^a])([^\b])([^c]*)([^d]{3,4})/
  1742. baNOTccccd
  1743. baNOTcccd
  1744. baNOTccd
  1745. bacccd
  1746. \= Expect no match
  1747. anything
  1748. b\bc
  1749. baccd
  1750. /[^a]/
  1751. Abc
  1752. /[^a]/i
  1753. Abc
  1754. /[^a]+/
  1755. AAAaAbc
  1756. /[^a]+/i
  1757. AAAaAbc
  1758. /[^a]+/
  1759. bbb\nccc
  1760. /[^k]$/
  1761. abc
  1762. \= Expect no match
  1763. abk
  1764. /[^k]{2,3}$/
  1765. abc
  1766. kbc
  1767. kabc
  1768. \= Expect no match
  1769. abk
  1770. akb
  1771. akk
  1772. /^\d{8,}\@.+[^k]$/
  1773. 12345678\@a.b.c.d
  1774. 123456789\@x.y.z
  1775. \= Expect no match
  1776. 12345678\@x.y.uk
  1777. 1234567\@a.b.c.d
  1778. /[^a]/
  1779. aaaabcd
  1780. aaAabcd
  1781. /[^a]/i
  1782. aaaabcd
  1783. aaAabcd
  1784. /[^az]/
  1785. aaaabcd
  1786. aaAabcd
  1787. /[^az]/i
  1788. aaaabcd
  1789. aaAabcd
  1790. /\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
  1791. \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
  1792. /P[^*]TAIRE[^*]{1,6}?LL/
  1793. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  1794. /P[^*]TAIRE[^*]{1,}?LL/
  1795. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  1796. /(\.\d\d[1-9]?)\d+/
  1797. 1.230003938
  1798. 1.875000282
  1799. 1.235
  1800. /(\.\d\d((?=0)|\d(?=\d)))/
  1801. 1.230003938
  1802. 1.875000282
  1803. \= Expect no match
  1804. 1.235
  1805. /a(?)b/
  1806. ab
  1807. /\b(foo)\s+(\w+)/i
  1808. Food is on the foo table
  1809. /foo(.*)bar/
  1810. The food is under the bar in the barn.
  1811. /foo(.*?)bar/
  1812. The food is under the bar in the barn.
  1813. /(.*)(\d*)/no_auto_possess
  1814. I have 2 numbers: 53147
  1815. /(.*)(\d+)/
  1816. I have 2 numbers: 53147
  1817. /(.*?)(\d*)/no_auto_possess
  1818. I have 2 numbers: 53147
  1819. /(.*?)(\d+)/
  1820. I have 2 numbers: 53147
  1821. /(.*)(\d+)$/
  1822. I have 2 numbers: 53147
  1823. /(.*?)(\d+)$/
  1824. I have 2 numbers: 53147
  1825. /(.*)\b(\d+)$/
  1826. I have 2 numbers: 53147
  1827. /(.*\D)(\d+)$/
  1828. I have 2 numbers: 53147
  1829. /^\D*(?!123)/
  1830. ABC123
  1831. /^(\D*)(?=\d)(?!123)/
  1832. ABC445
  1833. \= Expect no match
  1834. ABC123
  1835. /^[W-]46]/
  1836. W46]789
  1837. -46]789
  1838. \= Expect no match
  1839. Wall
  1840. Zebra
  1841. 42
  1842. [abcd]
  1843. ]abcd[
  1844. /^[W-\]46]/
  1845. W46]789
  1846. Wall
  1847. Zebra
  1848. Xylophone
  1849. 42
  1850. [abcd]
  1851. ]abcd[
  1852. \\backslash
  1853. \= Expect no match
  1854. -46]789
  1855. well
  1856. /\d\d\/\d\d\/\d\d\d\d/
  1857. 01/01/2000
  1858. /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
  1859. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  1860. \= Expect no match
  1861. word cat dog elephant mussel cow horse canary baboon snake shark
  1862. /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
  1863. \= Expect no match
  1864. word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
  1865. /^(a){0,0}/
  1866. bcd
  1867. abc
  1868. aab
  1869. /^(a){0,1}/
  1870. bcd
  1871. abc
  1872. aab
  1873. /^(a){0,2}/
  1874. bcd
  1875. abc
  1876. aab
  1877. /^(a){0,3}/
  1878. bcd
  1879. abc
  1880. aab
  1881. aaa
  1882. /^(a){0,}/
  1883. bcd
  1884. abc
  1885. aab
  1886. aaa
  1887. aaaaaaaa
  1888. /^(a){1,1}/
  1889. abc
  1890. aab
  1891. \= Expect no match
  1892. bcd
  1893. /^(a){1,2}/
  1894. abc
  1895. aab
  1896. \= Expect no match
  1897. bcd
  1898. /^(a){1,3}/
  1899. abc
  1900. aab
  1901. aaa
  1902. \= Expect no match
  1903. bcd
  1904. /^(a){1,}/
  1905. abc
  1906. aab
  1907. aaa
  1908. aaaaaaaa
  1909. \= Expect no match
  1910. bcd
  1911. /.*\.gif/
  1912. borfle\nbib.gif\nno
  1913. /.{0,}\.gif/
  1914. borfle\nbib.gif\nno
  1915. /.*\.gif/m
  1916. borfle\nbib.gif\nno
  1917. /.*\.gif/s
  1918. borfle\nbib.gif\nno
  1919. /.*\.gif/ms
  1920. borfle\nbib.gif\nno
  1921. /.*$/
  1922. borfle\nbib.gif\nno
  1923. /.*$/m
  1924. borfle\nbib.gif\nno
  1925. /.*$/s
  1926. borfle\nbib.gif\nno
  1927. /.*$/ms
  1928. borfle\nbib.gif\nno
  1929. /.*$/
  1930. borfle\nbib.gif\nno\n
  1931. /.*$/m
  1932. borfle\nbib.gif\nno\n
  1933. /.*$/s
  1934. borfle\nbib.gif\nno\n
  1935. /.*$/ms
  1936. borfle\nbib.gif\nno\n
  1937. /(.*X|^B)/
  1938. abcde\n1234Xyz
  1939. BarFoo
  1940. \= Expect no match
  1941. abcde\nBar
  1942. /(.*X|^B)/m
  1943. abcde\n1234Xyz
  1944. BarFoo
  1945. abcde\nBar
  1946. /(.*X|^B)/s
  1947. abcde\n1234Xyz
  1948. BarFoo
  1949. \= Expect no match
  1950. abcde\nBar
  1951. /(.*X|^B)/ms
  1952. abcde\n1234Xyz
  1953. BarFoo
  1954. abcde\nBar
  1955. /(?s)(.*X|^B)/
  1956. abcde\n1234Xyz
  1957. BarFoo
  1958. \= Expect no match
  1959. abcde\nBar
  1960. /(?s:.*X|^B)/
  1961. abcde\n1234Xyz
  1962. BarFoo
  1963. \= Expect no match
  1964. abcde\nBar
  1965. /^.*B/
  1966. \= Expect no match
  1967. abc\nB
  1968. /(?s)^.*B/
  1969. abc\nB
  1970. /(?m)^.*B/
  1971. abc\nB
  1972. /(?ms)^.*B/
  1973. abc\nB
  1974. /(?ms)^B/
  1975. abc\nB
  1976. /(?s)B$/
  1977. B\n
  1978. /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
  1979. 123456654321
  1980. /^\d\d\d\d\d\d\d\d\d\d\d\d/
  1981. 123456654321
  1982. /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
  1983. 123456654321
  1984. /^[abc]{12}/
  1985. abcabcabcabc
  1986. /^[a-c]{12}/
  1987. abcabcabcabc
  1988. /^(a|b|c){12}/
  1989. abcabcabcabc
  1990. /^[abcdefghijklmnopqrstuvwxy0123456789]/
  1991. n
  1992. \= Expect no match
  1993. z
  1994. /abcde{0,0}/
  1995. abcd
  1996. \= Expect no match
  1997. abce
  1998. /ab[cd]{0,0}e/
  1999. abe
  2000. \= Expect no match
  2001. abcde
  2002. /ab(c){0,0}d/
  2003. abd
  2004. \= Expect no match
  2005. abcd
  2006. /a(b*)/
  2007. a
  2008. ab
  2009. abbbb
  2010. \= Expect no match
  2011. bbbbb
  2012. /ab\d{0}e/
  2013. abe
  2014. \= Expect no match
  2015. ab1e
  2016. /"([^\\"]+|\\.)*"/
  2017. the \"quick\" brown fox
  2018. \"the \\\"quick\\\" brown fox\"
  2019. /.*?/g,aftertext
  2020. abc
  2021. /\b/g,aftertext
  2022. abc
  2023. /\b/g,aftertext
  2024. abc
  2025. //g
  2026. abc
  2027. /<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>/is
  2028. <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR>
  2029. /a[^a]b/
  2030. acb
  2031. a\nb
  2032. /a.b/
  2033. acb
  2034. \= Expect no match
  2035. a\nb
  2036. /a[^a]b/s
  2037. acb
  2038. a\nb
  2039. /a.b/s
  2040. acb
  2041. a\nb
  2042. /^(b+?|a){1,2}?c/
  2043. bac
  2044. bbac
  2045. bbbac
  2046. bbbbac
  2047. bbbbbac
  2048. /^(b+|a){1,2}?c/
  2049. bac
  2050. bbac
  2051. bbbac
  2052. bbbbac
  2053. bbbbbac
  2054. /(?!\A)x/m
  2055. a\bx\n
  2056. \= Expect no match
  2057. x\nb\n
  2058. /\x0{ab}/
  2059. \0{ab}
  2060. /(A|B)*?CD/
  2061. CD
  2062. /(A|B)*CD/
  2063. CD
  2064. /(?<!bar)foo/
  2065. foo
  2066. catfood
  2067. arfootle
  2068. rfoosh
  2069. \= Expect no match
  2070. barfoo
  2071. towbarfoo
  2072. /\w{3}(?<!bar)foo/
  2073. catfood
  2074. \= Expect no match
  2075. foo
  2076. barfoo
  2077. towbarfoo
  2078. /(?<=(foo)a)bar/
  2079. fooabar
  2080. \= Expect no match
  2081. bar
  2082. foobbar
  2083. /\Aabc\z/m
  2084. abc
  2085. \= Expect no match
  2086. abc\n
  2087. qqq\nabc
  2088. abc\nzzz
  2089. qqq\nabc\nzzz
  2090. "(?>.*/)foo"
  2091. \= Expect no match
  2092. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
  2093. "(?>.*/)foo"
  2094. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
  2095. /(?>(\.\d\d[1-9]?))\d+/
  2096. 1.230003938
  2097. 1.875000282
  2098. \= Expect no match
  2099. 1.235
  2100. /^((?>\w+)|(?>\s+))*$/
  2101. now is the time for all good men to come to the aid of the party
  2102. \= Expect no match
  2103. this is not a line with only words and spaces!
  2104. /(\d+)(\w)/
  2105. 12345a
  2106. 12345+
  2107. /((?>\d+))(\w)/
  2108. 12345a
  2109. \= Expect no match
  2110. 12345+
  2111. /(?>a+)b/
  2112. aaab
  2113. /((?>a+)b)/
  2114. aaab
  2115. /(?>(a+))b/
  2116. aaab
  2117. /(?>b)+/
  2118. aaabbbccc
  2119. /(?>a+|b+|c+)*c/
  2120. aaabbbbccccd
  2121. /(a+|b+|c+)*c/
  2122. aaabbbbccccd
  2123. /((?>[^()]+)|\([^()]*\))+/
  2124. ((abc(ade)ufh()()x
  2125. /\(((?>[^()]+)|\([^()]+\))+\)/
  2126. (abc)
  2127. (abc(def)xyz)
  2128. \= Expect no match
  2129. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  2130. /a(?-i)b/i
  2131. ab
  2132. Ab
  2133. \= Expect no match
  2134. aB
  2135. AB
  2136. /(a (?x)b c)d e/
  2137. a bcd e
  2138. \= Expect no match
  2139. a b cd e
  2140. abcd e
  2141. a bcde
  2142. /(a b(?x)c d (?-x)e f)/
  2143. a bcde f
  2144. \= Expect no match
  2145. abcdef
  2146. /(a(?i)b)c/
  2147. abc
  2148. aBc
  2149. \= Expect no match
  2150. abC
  2151. aBC
  2152. Abc
  2153. ABc
  2154. ABC
  2155. AbC
  2156. /a(?i:b)c/
  2157. abc
  2158. aBc
  2159. \= Expect no match
  2160. ABC
  2161. abC
  2162. aBC
  2163. /a(?i:b)*c/
  2164. aBc
  2165. aBBc
  2166. \= Expect no match
  2167. aBC
  2168. aBBC
  2169. /a(?=b(?i)c)\w\wd/
  2170. abcd
  2171. abCd
  2172. \= Expect no match
  2173. aBCd
  2174. abcD
  2175. /(?s-i:more.*than).*million/i
  2176. more than million
  2177. more than MILLION
  2178. more \n than Million
  2179. \= Expect no match
  2180. MORE THAN MILLION
  2181. more \n than \n million
  2182. /(?:(?s-i)more.*than).*million/i
  2183. more than million
  2184. more than MILLION
  2185. more \n than Million
  2186. \= Expect no match
  2187. MORE THAN MILLION
  2188. more \n than \n million
  2189. /(?>a(?i)b+)+c/
  2190. abc
  2191. aBbc
  2192. aBBc
  2193. \= Expect no match
  2194. Abc
  2195. abAb
  2196. abbC
  2197. /(?=a(?i)b)\w\wc/
  2198. abc
  2199. aBc
  2200. \= Expect no match
  2201. Ab
  2202. abC
  2203. aBC
  2204. /(?<=a(?i)b)(\w\w)c/
  2205. abxxc
  2206. aBxxc
  2207. \= Expect no match
  2208. Abxxc
  2209. ABxxc
  2210. abxxC
  2211. /^(?(?=abc)\w{3}:|\d\d)$/
  2212. abc:
  2213. 12
  2214. \= Expect no match
  2215. 123
  2216. xyz
  2217. /^(?(?!abc)\d\d|\w{3}:)$/
  2218. abc:
  2219. 12
  2220. \= Expect no match
  2221. 123
  2222. xyz
  2223. /(?(?<=foo)bar|cat)/
  2224. foobar
  2225. cat
  2226. fcat
  2227. focat
  2228. \= Expect no match
  2229. foocat
  2230. /(?(?<!foo)cat|bar)/
  2231. foobar
  2232. cat
  2233. fcat
  2234. focat
  2235. \= Expect no match
  2236. foocat
  2237. /(?>a*)*/
  2238. a
  2239. aa
  2240. aaaa
  2241. /(abc|)+/
  2242. abc
  2243. abcabc
  2244. abcabcabc
  2245. xyz
  2246. /([a]*)*/
  2247. a
  2248. aaaaa
  2249. /([ab]*)*/
  2250. a
  2251. b
  2252. ababab
  2253. aaaabcde
  2254. bbbb
  2255. /([^a]*)*/
  2256. b
  2257. bbbb
  2258. aaa
  2259. /([^ab]*)*/
  2260. cccc
  2261. abab
  2262. /([a]*?)*/
  2263. a
  2264. aaaa
  2265. /([ab]*?)*/
  2266. a
  2267. b
  2268. abab
  2269. baba
  2270. /([^a]*?)*/
  2271. b
  2272. bbbb
  2273. aaa
  2274. /([^ab]*?)*/
  2275. c
  2276. cccc
  2277. baba
  2278. /(?>a*)*/
  2279. a
  2280. aaabcde
  2281. /((?>a*))*/
  2282. aaaaa
  2283. aabbaa
  2284. /((?>a*?))*/
  2285. aaaaa
  2286. aabbaa
  2287. /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
  2288. 12-sep-98
  2289. 12-09-98
  2290. \= Expect no match
  2291. sep-12-98
  2292. /(?i:saturday|sunday)/
  2293. saturday
  2294. sunday
  2295. Saturday
  2296. Sunday
  2297. SATURDAY
  2298. SUNDAY
  2299. SunDay
  2300. /(a(?i)bc|BB)x/
  2301. abcx
  2302. aBCx
  2303. bbx
  2304. BBx
  2305. \= Expect no match
  2306. abcX
  2307. aBCX
  2308. bbX
  2309. BBX
  2310. /^([ab](?i)[cd]|[ef])/
  2311. ac
  2312. aC
  2313. bD
  2314. elephant
  2315. Europe
  2316. frog
  2317. France
  2318. \= Expect no match
  2319. Africa
  2320. /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
  2321. ab
  2322. aBd
  2323. xy
  2324. xY
  2325. zebra
  2326. Zambesi
  2327. \= Expect no match
  2328. aCD
  2329. XY
  2330. /(?<=foo\n)^bar/m
  2331. foo\nbar
  2332. \= Expect no match
  2333. bar
  2334. baz\nbar
  2335. /(?<=(?<!foo)bar)baz/
  2336. barbaz
  2337. barbarbaz
  2338. koobarbaz
  2339. \= Expect no match
  2340. baz
  2341. foobarbaz
  2342. # The following tests are taken from the Perl 5.005 test suite; some of them
  2343. # are compatible with 5.004, but I'd rather not have to sort them out.
  2344. /abc/
  2345. abc
  2346. xabcy
  2347. ababc
  2348. \= Expect no match
  2349. xbc
  2350. axc
  2351. abx
  2352. /ab*c/
  2353. abc
  2354. /ab*bc/
  2355. abc
  2356. abbc
  2357. abbbbc
  2358. /.{1}/
  2359. abbbbc
  2360. /.{3,4}/
  2361. abbbbc
  2362. /ab{0,}bc/
  2363. abbbbc
  2364. /ab+bc/
  2365. abbc
  2366. \= Expect no match
  2367. abc
  2368. abq
  2369. /ab+bc/
  2370. abbbbc
  2371. /ab{1,}bc/
  2372. abbbbc
  2373. /ab{1,3}bc/
  2374. abbbbc
  2375. /ab{3,4}bc/
  2376. abbbbc
  2377. /ab{4,5}bc/
  2378. \= Expect no match
  2379. abq
  2380. abbbbc
  2381. /ab?bc/
  2382. abbc
  2383. abc
  2384. /ab{0,1}bc/
  2385. abc
  2386. /ab?bc/
  2387. /ab?c/
  2388. abc
  2389. /ab{0,1}c/
  2390. abc
  2391. /^abc$/
  2392. abc
  2393. \= Expect no match
  2394. abbbbc
  2395. abcc
  2396. /^abc/
  2397. abcc
  2398. /^abc$/
  2399. /abc$/
  2400. aabc
  2401. aabc
  2402. \= Expect no match
  2403. aabcd
  2404. /^/
  2405. abc
  2406. /$/
  2407. abc
  2408. /a.c/
  2409. abc
  2410. axc
  2411. /a.*c/
  2412. axyzc
  2413. /a[bc]d/
  2414. abd
  2415. \= Expect no match
  2416. axyzd
  2417. abc
  2418. /a[b-d]e/
  2419. ace
  2420. /a[b-d]/
  2421. aac
  2422. /a[-b]/
  2423. a-
  2424. /a[b-]/
  2425. a-
  2426. /a]/
  2427. a]
  2428. /a[]]b/
  2429. a]b
  2430. /a[^bc]d/
  2431. aed
  2432. \= Expect no match
  2433. abd
  2434. abd
  2435. /a[^-b]c/
  2436. adc
  2437. /a[^]b]c/
  2438. adc
  2439. a-c
  2440. \= Expect no match
  2441. a]c
  2442. /\ba\b/
  2443. a-
  2444. -a
  2445. -a-
  2446. /\by\b/
  2447. \= Expect no match
  2448. xy
  2449. yz
  2450. xyz
  2451. /\Ba\B/
  2452. \= Expect no match
  2453. a-
  2454. -a
  2455. -a-
  2456. /\By\b/
  2457. xy
  2458. /\by\B/
  2459. yz
  2460. /\By\B/
  2461. xyz
  2462. /\w/
  2463. a
  2464. /\W/
  2465. -
  2466. \= Expect no match
  2467. a
  2468. /a\sb/
  2469. a b
  2470. /a\Sb/
  2471. a-b
  2472. \= Expect no match
  2473. a b
  2474. /\d/
  2475. 1
  2476. /\D/
  2477. -
  2478. \= Expect no match
  2479. 1
  2480. /[\w]/
  2481. a
  2482. /[\W]/
  2483. -
  2484. \= Expect no match
  2485. a
  2486. /a[\s]b/
  2487. a b
  2488. /a[\S]b/
  2489. a-b
  2490. \= Expect no match
  2491. a b
  2492. /[\d]/
  2493. 1
  2494. /[\D]/
  2495. -
  2496. \= Expect no match
  2497. 1
  2498. /ab|cd/
  2499. abc
  2500. abcd
  2501. /()ef/
  2502. def
  2503. /$b/
  2504. /a\(b/
  2505. a(b
  2506. /a\(*b/
  2507. ab
  2508. a((b
  2509. /a\\b/
  2510. a\\b
  2511. \= Expect no match
  2512. a\b
  2513. /((a))/
  2514. abc
  2515. /(a)b(c)/
  2516. abc
  2517. /a+b+c/
  2518. aabbabc
  2519. /a{1,}b{1,}c/
  2520. aabbabc
  2521. /a.+?c/
  2522. abcabc
  2523. /(a+|b)*/
  2524. ab
  2525. /(a+|b){0,}/
  2526. ab
  2527. /(a+|b)+/
  2528. ab
  2529. /(a+|b){1,}/
  2530. ab
  2531. /(a+|b)?/
  2532. ab
  2533. /(a+|b){0,1}/
  2534. ab
  2535. /[^ab]*/
  2536. cde
  2537. /abc/
  2538. \= Expect no match
  2539. b
  2540. /a*/
  2541. /([abc])*d/
  2542. abbbcd
  2543. /([abc])*bcd/
  2544. abcd
  2545. /a|b|c|d|e/
  2546. e
  2547. /(a|b|c|d|e)f/
  2548. ef
  2549. /abcd*efg/
  2550. abcdefg
  2551. /ab*/
  2552. xabyabbbz
  2553. xayabbbz
  2554. /(ab|cd)e/
  2555. abcde
  2556. /[abhgefdc]ij/
  2557. hij
  2558. /^(ab|cd)e/
  2559. /(abc|)ef/
  2560. abcdef
  2561. /(a|b)c*d/
  2562. abcd
  2563. /(ab|ab*)bc/
  2564. abc
  2565. /a([bc]*)c*/
  2566. abc
  2567. /a([bc]*)(c*d)/
  2568. abcd
  2569. /a([bc]+)(c*d)/
  2570. abcd
  2571. /a([bc]*)(c+d)/
  2572. abcd
  2573. /a[bcd]*dcdcde/
  2574. adcdcde
  2575. /a[bcd]+dcdcde/
  2576. \= Expect no match
  2577. abcde
  2578. adcdcde
  2579. /(ab|a)b*c/
  2580. abc
  2581. /((a)(b)c)(d)/
  2582. abcd
  2583. /[a-zA-Z_][a-zA-Z0-9_]*/
  2584. alpha
  2585. /^a(bc+|b[eh])g|.h$/
  2586. abh
  2587. /(bc+d$|ef*g.|h?i(j|k))/
  2588. effgz
  2589. ij
  2590. reffgz
  2591. \= Expect no match
  2592. effg
  2593. bcdd
  2594. /((((((((((a))))))))))/
  2595. a
  2596. /(((((((((a)))))))))/
  2597. a
  2598. /multiple words of text/
  2599. \= Expect no match
  2600. aa
  2601. uh-uh
  2602. /multiple words/
  2603. multiple words, yeah
  2604. /(.*)c(.*)/
  2605. abcde
  2606. /\((.*), (.*)\)/
  2607. (a, b)
  2608. /[k]/
  2609. /abcd/
  2610. abcd
  2611. /a(bc)d/
  2612. abcd
  2613. /a[-]?c/
  2614. ac
  2615. /abc/i
  2616. ABC
  2617. XABCY
  2618. ABABC
  2619. \= Expect no match
  2620. aaxabxbaxbbx
  2621. XBC
  2622. AXC
  2623. ABX
  2624. /ab*c/i
  2625. ABC
  2626. /ab*bc/i
  2627. ABC
  2628. ABBC
  2629. /ab*?bc/i
  2630. ABBBBC
  2631. /ab{0,}?bc/i
  2632. ABBBBC
  2633. /ab+?bc/i
  2634. ABBC
  2635. /ab+bc/i
  2636. \= Expect no match
  2637. ABC
  2638. ABQ
  2639. /ab{1,}bc/i
  2640. /ab+bc/i
  2641. ABBBBC
  2642. /ab{1,}?bc/i
  2643. ABBBBC
  2644. /ab{1,3}?bc/i
  2645. ABBBBC
  2646. /ab{3,4}?bc/i
  2647. ABBBBC
  2648. /ab{4,5}?bc/i
  2649. \= Expect no match
  2650. ABQ
  2651. ABBBBC
  2652. /ab??bc/i
  2653. ABBC
  2654. ABC
  2655. /ab{0,1}?bc/i
  2656. ABC
  2657. /ab??bc/i
  2658. /ab??c/i
  2659. ABC
  2660. /ab{0,1}?c/i
  2661. ABC
  2662. /^abc$/i
  2663. ABC
  2664. \= Expect no match
  2665. ABBBBC
  2666. ABCC
  2667. /^abc/i
  2668. ABCC
  2669. /^abc$/i
  2670. /abc$/i
  2671. AABC
  2672. /^/i
  2673. ABC
  2674. /$/i
  2675. ABC
  2676. /a.c/i
  2677. ABC
  2678. AXC
  2679. /a.*?c/i
  2680. AXYZC
  2681. /a.*c/i
  2682. AABC
  2683. \= Expect no match
  2684. AXYZD
  2685. /a[bc]d/i
  2686. ABD
  2687. /a[b-d]e/i
  2688. ACE
  2689. \= Expect no match
  2690. ABC
  2691. ABD
  2692. /a[b-d]/i
  2693. AAC
  2694. /a[-b]/i
  2695. A-
  2696. /a[b-]/i
  2697. A-
  2698. /a]/i
  2699. A]
  2700. /a[]]b/i
  2701. A]B
  2702. /a[^bc]d/i
  2703. AED
  2704. /a[^-b]c/i
  2705. ADC
  2706. \= Expect no match
  2707. ABD
  2708. A-C
  2709. /a[^]b]c/i
  2710. ADC
  2711. /ab|cd/i
  2712. ABC
  2713. ABCD
  2714. /()ef/i
  2715. DEF
  2716. /$b/i
  2717. \= Expect no match
  2718. A]C
  2719. B
  2720. /a\(b/i
  2721. A(B
  2722. /a\(*b/i
  2723. AB
  2724. A((B
  2725. /a\\b/i
  2726. \= Expect no match
  2727. A\=notbol
  2728. /((a))/i
  2729. ABC
  2730. /(a)b(c)/i
  2731. ABC
  2732. /a+b+c/i
  2733. AABBABC
  2734. /a{1,}b{1,}c/i
  2735. AABBABC
  2736. /a.+?c/i
  2737. ABCABC
  2738. /a.*?c/i
  2739. ABCABC
  2740. /a.{0,5}?c/i
  2741. ABCABC
  2742. /(a+|b)*/i
  2743. AB
  2744. /(a+|b){0,}/i
  2745. AB
  2746. /(a+|b)+/i
  2747. AB
  2748. /(a+|b){1,}/i
  2749. AB
  2750. /(a+|b)?/i
  2751. AB
  2752. /(a+|b){0,1}/i
  2753. AB
  2754. /(a+|b){0,1}?/i
  2755. AB
  2756. /[^ab]*/i
  2757. CDE
  2758. /abc/i
  2759. /a*/i
  2760. /([abc])*d/i
  2761. ABBBCD
  2762. /([abc])*bcd/i
  2763. ABCD
  2764. /a|b|c|d|e/i
  2765. E
  2766. /(a|b|c|d|e)f/i
  2767. EF
  2768. /abcd*efg/i
  2769. ABCDEFG
  2770. /ab*/i
  2771. XABYABBBZ
  2772. XAYABBBZ
  2773. /(ab|cd)e/i
  2774. ABCDE
  2775. /[abhgefdc]ij/i
  2776. HIJ
  2777. /^(ab|cd)e/i
  2778. \= Expect no match
  2779. ABCDE
  2780. /(abc|)ef/i
  2781. ABCDEF
  2782. /(a|b)c*d/i
  2783. ABCD
  2784. /(ab|ab*)bc/i
  2785. ABC
  2786. /a([bc]*)c*/i
  2787. ABC
  2788. /a([bc]*)(c*d)/i
  2789. ABCD
  2790. /a([bc]+)(c*d)/i
  2791. ABCD
  2792. /a([bc]*)(c+d)/i
  2793. ABCD
  2794. /a[bcd]*dcdcde/i
  2795. ADCDCDE
  2796. /a[bcd]+dcdcde/i
  2797. /(ab|a)b*c/i
  2798. ABC
  2799. /((a)(b)c)(d)/i
  2800. ABCD
  2801. /[a-zA-Z_][a-zA-Z0-9_]*/i
  2802. ALPHA
  2803. /^a(bc+|b[eh])g|.h$/i
  2804. ABH
  2805. /(bc+d$|ef*g.|h?i(j|k))/i
  2806. EFFGZ
  2807. IJ
  2808. REFFGZ
  2809. \= Expect no match
  2810. ADCDCDE
  2811. EFFG
  2812. BCDD
  2813. /((((((((((a))))))))))/i
  2814. A
  2815. /(((((((((a)))))))))/i
  2816. A
  2817. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
  2818. A
  2819. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
  2820. C
  2821. /multiple words of text/i
  2822. \= Expect no match
  2823. AA
  2824. UH-UH
  2825. /multiple words/i
  2826. MULTIPLE WORDS, YEAH
  2827. /(.*)c(.*)/i
  2828. ABCDE
  2829. /\((.*), (.*)\)/i
  2830. (A, B)
  2831. /[k]/i
  2832. /abcd/i
  2833. ABCD
  2834. /a(bc)d/i
  2835. ABCD
  2836. /a[-]?c/i
  2837. AC
  2838. /a(?!b)./
  2839. abad
  2840. /a(?=d)./
  2841. abad
  2842. /a(?=c|d)./
  2843. abad
  2844. /a(?:b|c|d)(.)/
  2845. ace
  2846. /a(?:b|c|d)*(.)/
  2847. ace
  2848. /a(?:b|c|d)+?(.)/
  2849. ace
  2850. acdbcdbe
  2851. /a(?:b|c|d)+(.)/
  2852. acdbcdbe
  2853. /a(?:b|c|d){2}(.)/
  2854. acdbcdbe
  2855. /a(?:b|c|d){4,5}(.)/
  2856. acdbcdbe
  2857. /a(?:b|c|d){4,5}?(.)/
  2858. acdbcdbe
  2859. /((foo)|(bar))*/
  2860. foobar
  2861. /a(?:b|c|d){6,7}(.)/
  2862. acdbcdbe
  2863. /a(?:b|c|d){6,7}?(.)/
  2864. acdbcdbe
  2865. /a(?:b|c|d){5,6}(.)/
  2866. acdbcdbe
  2867. /a(?:b|c|d){5,6}?(.)/
  2868. acdbcdbe
  2869. /a(?:b|c|d){5,7}(.)/
  2870. acdbcdbe
  2871. /a(?:b|c|d){5,7}?(.)/
  2872. acdbcdbe
  2873. /a(?:b|(c|e){1,2}?|d)+?(.)/
  2874. ace
  2875. /^(.+)?B/
  2876. AB
  2877. /^([^a-z])|(\^)$/
  2878. .
  2879. /^[<>]&/
  2880. <&OUT
  2881. /(?:(f)(o)(o)|(b)(a)(r))*/
  2882. foobar
  2883. /(?<=a)b/
  2884. ab
  2885. \= Expect no match
  2886. cb
  2887. b
  2888. /(?<!c)b/
  2889. ab
  2890. b
  2891. b
  2892. /(?:..)*a/
  2893. aba
  2894. /(?:..)*?a/
  2895. aba
  2896. /^(){3,5}/
  2897. abc
  2898. /^(a+)*ax/
  2899. aax
  2900. /^((a|b)+)*ax/
  2901. aax
  2902. /^((a|bc)+)*ax/
  2903. aax
  2904. /(a|x)*ab/
  2905. cab
  2906. /(a)*ab/
  2907. cab
  2908. /(?:(?i)a)b/
  2909. ab
  2910. /((?i)a)b/
  2911. ab
  2912. /(?:(?i)a)b/
  2913. Ab
  2914. /((?i)a)b/
  2915. Ab
  2916. /(?:(?i)a)b/
  2917. \= Expect no match
  2918. cb
  2919. aB
  2920. /((?i)a)b/
  2921. /(?i:a)b/
  2922. ab
  2923. /((?i:a))b/
  2924. ab
  2925. /(?i:a)b/
  2926. Ab
  2927. /((?i:a))b/
  2928. Ab
  2929. /(?i:a)b/
  2930. \= Expect no match
  2931. aB
  2932. aB
  2933. /((?i:a))b/
  2934. /(?:(?-i)a)b/i
  2935. ab
  2936. /((?-i)a)b/i
  2937. ab
  2938. /(?:(?-i)a)b/i
  2939. aB
  2940. /((?-i)a)b/i
  2941. aB
  2942. /(?:(?-i)a)b/i
  2943. aB
  2944. \= Expect no match
  2945. Ab
  2946. /((?-i)a)b/i
  2947. /(?:(?-i)a)b/i
  2948. aB
  2949. /((?-i)a)b/i
  2950. aB
  2951. /(?:(?-i)a)b/i
  2952. \= Expect no match
  2953. Ab
  2954. AB
  2955. /((?-i)a)b/i
  2956. /(?-i:a)b/i
  2957. ab
  2958. /((?-i:a))b/i
  2959. ab
  2960. /(?-i:a)b/i
  2961. aB
  2962. /((?-i:a))b/i
  2963. aB
  2964. /(?-i:a)b/i
  2965. \= Expect no match
  2966. AB
  2967. Ab
  2968. /((?-i:a))b/i
  2969. /(?-i:a)b/i
  2970. aB
  2971. /((?-i:a))b/i
  2972. aB
  2973. /(?-i:a)b/i
  2974. \= Expect no match
  2975. Ab
  2976. AB
  2977. /((?-i:a))b/i
  2978. /((?-i:a.))b/i
  2979. \= Expect no match
  2980. AB
  2981. a\nB
  2982. /((?s-i:a.))b/i
  2983. a\nB
  2984. /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
  2985. cabbbb
  2986. /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
  2987. caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  2988. /foo\w*\d{4}baz/
  2989. foobar1234baz
  2990. /x(~~)*(?:(?:F)?)?/
  2991. x~~
  2992. /^a(?#xxx){3}c/
  2993. aaac
  2994. /^a (?#xxx) (?#yyy) {3}c/x
  2995. aaac
  2996. /(?<![cd])b/
  2997. \= Expect no match
  2998. B\nB
  2999. dbcb
  3000. /(?<![cd])[ab]/
  3001. dbaacb
  3002. /(?<!(c|d))b/
  3003. /(?<!(c|d))[ab]/
  3004. dbaacb
  3005. /(?<!cd)[ab]/
  3006. cdaccb
  3007. /^(?:a?b?)*$/
  3008. \= Expect no match
  3009. dbcb
  3010. a--
  3011. /((?s)^a(.))((?m)^b$)/
  3012. a\nb\nc\n
  3013. /((?m)^b$)/
  3014. a\nb\nc\n
  3015. /(?m)^b/
  3016. a\nb\n
  3017. /(?m)^(b)/
  3018. a\nb\n
  3019. /((?m)^b)/
  3020. a\nb\n
  3021. /\n((?m)^b)/
  3022. a\nb\n
  3023. /((?s).)c(?!.)/
  3024. a\nb\nc\n
  3025. a\nb\nc\n
  3026. /((?s)b.)c(?!.)/
  3027. a\nb\nc\n
  3028. a\nb\nc\n
  3029. /^b/
  3030. /()^b/
  3031. \= Expect no match
  3032. a\nb\nc\n
  3033. a\nb\nc\n
  3034. /((?m)^b)/
  3035. a\nb\nc\n
  3036. /(?(?!a)a|b)/
  3037. /(?(?!a)b|a)/
  3038. a
  3039. /(?(?=a)b|a)/
  3040. \= Expect no match
  3041. a
  3042. a
  3043. /(?(?=a)a|b)/
  3044. a
  3045. /(\w+:)+/
  3046. one:
  3047. /$(?<=^(a))/
  3048. a
  3049. /([\w:]+::)?(\w+)$/
  3050. abcd
  3051. xy:z:::abcd
  3052. /^[^bcd]*(c+)/
  3053. aexycd
  3054. /(a*)b+/
  3055. caab
  3056. /([\w:]+::)?(\w+)$/
  3057. abcd
  3058. xy:z:::abcd
  3059. \= Expect no match
  3060. abcd:
  3061. abcd:
  3062. /^[^bcd]*(c+)/
  3063. aexycd
  3064. /(>a+)ab/
  3065. /(?>a+)b/
  3066. aaab
  3067. /([[:]+)/
  3068. a:[b]:
  3069. /([[=]+)/
  3070. a=[b]=
  3071. /([[.]+)/
  3072. a.[b].
  3073. /((?>a+)b)/
  3074. aaab
  3075. /(?>(a+))b/
  3076. aaab
  3077. /((?>[^()]+)|\([^()]*\))+/
  3078. ((abc(ade)ufh()()x
  3079. /a\Z/
  3080. \= Expect no match
  3081. aaab
  3082. a\nb\n
  3083. /b\Z/
  3084. a\nb\n
  3085. /b\z/
  3086. /b\Z/
  3087. a\nb
  3088. /b\z/
  3089. a\nb
  3090. /(?>.*)(?<=(abcd|wxyz))/
  3091. alphabetabcd
  3092. endingwxyz
  3093. \= Expect no match
  3094. a rather long string that doesn't end with one of them
  3095. /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
  3096. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  3097. \= Expect no match
  3098. word cat dog elephant mussel cow horse canary baboon snake shark
  3099. /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
  3100. \= Expect no match
  3101. word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
  3102. /(?<=\d{3}(?!999))foo/
  3103. 999foo
  3104. 123999foo
  3105. \= Expect no match
  3106. 123abcfoo
  3107. /(?<=(?!...999)\d{3})foo/
  3108. 999foo
  3109. 123999foo
  3110. \= Expect no match
  3111. 123abcfoo
  3112. /(?<=\d{3}(?!999)...)foo/
  3113. 123abcfoo
  3114. 123456foo
  3115. \= Expect no match
  3116. 123999foo
  3117. /(?<=\d{3}...)(?<!999)foo/
  3118. 123abcfoo
  3119. 123456foo
  3120. \= Expect no match
  3121. 123999foo
  3122. /((Z)+|A)*/
  3123. ZABCDEFG
  3124. /(Z()|A)*/
  3125. ZABCDEFG
  3126. /(Z(())|A)*/
  3127. ZABCDEFG
  3128. /((?>Z)+|A)*/
  3129. ZABCDEFG
  3130. /((?>)+|A)*/
  3131. ZABCDEFG
  3132. /a*/g
  3133. abbab
  3134. /[[:space:]]+/
  3135. > \x09\x0a\x0c\x0d\x0b<
  3136. /[[:blank:]]+/
  3137. > \x09\x0a\x0c\x0d\x0b<
  3138. /[\s]+/
  3139. > \x09\x0a\x0c\x0d\x0b<
  3140. /\s+/
  3141. > \x09\x0a\x0c\x0d\x0b<
  3142. /a b/x
  3143. ab
  3144. /(?!\A)x/m
  3145. a\nxb\n
  3146. /(?!^)x/m
  3147. \= Expect no match
  3148. a\nxb\n
  3149. /abc\Qabc\Eabc/
  3150. abcabcabc
  3151. /abc\Q(*+|\Eabc/
  3152. abc(*+|abc
  3153. / abc\Q abc\Eabc/x
  3154. abc abcabc
  3155. \= Expect no match
  3156. abcabcabc
  3157. /abc#comment
  3158. \Q#not comment
  3159. literal\E/x
  3160. abc#not comment\n literal
  3161. /abc#comment
  3162. \Q#not comment
  3163. literal/x
  3164. abc#not comment\n literal
  3165. /abc#comment
  3166. \Q#not comment
  3167. literal\E #more comment
  3168. /x
  3169. abc#not comment\n literal
  3170. /abc#comment
  3171. \Q#not comment
  3172. literal\E #more comment/x
  3173. abc#not comment\n literal
  3174. /\Qabc\$xyz\E/
  3175. abc\\\$xyz
  3176. /\Qabc\E\$\Qxyz\E/
  3177. abc\$xyz
  3178. /\Gabc/
  3179. abc
  3180. \= Expect no match
  3181. xyzabc
  3182. /\Gabc./g
  3183. abc1abc2xyzabc3
  3184. /abc./g
  3185. abc1abc2xyzabc3
  3186. /a(?x: b c )d/
  3187. XabcdY
  3188. \= Expect no match
  3189. Xa b c d Y
  3190. /((?x)x y z | a b c)/
  3191. XabcY
  3192. AxyzB
  3193. /(?i)AB(?-i)C/
  3194. XabCY
  3195. \= Expect no match
  3196. XabcY
  3197. /((?i)AB(?-i)C|D)E/
  3198. abCE
  3199. DE
  3200. \= Expect no match
  3201. abcE
  3202. abCe
  3203. dE
  3204. De
  3205. /[z\Qa-d]\E]/
  3206. z
  3207. a
  3208. -
  3209. d
  3210. ]
  3211. \= Expect no match
  3212. b
  3213. /(a+)*b/
  3214. \= Expect no match
  3215. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3216. /(?i)reg(?:ul(?:[a�]|ae)r|ex)/
  3217. REGular
  3218. regulaer
  3219. Regex
  3220. regul�r
  3221. /����[�-��-�]+/
  3222. �����
  3223. �����
  3224. �����
  3225. �����
  3226. /(?<=Z)X./
  3227. \x84XAZXB
  3228. /^(?(2)a|(1)(2))+$/
  3229. 123a
  3230. /(?<=a|bbbb)c/
  3231. ac
  3232. bbbbc
  3233. /line\nbreak/
  3234. this is a line\nbreak
  3235. line one\nthis is a line\nbreak in the second line
  3236. /line\nbreak/firstline
  3237. this is a line\nbreak
  3238. \= Expect no match
  3239. line one\nthis is a line\nbreak in the second line
  3240. /line\nbreak/m,firstline
  3241. this is a line\nbreak
  3242. \= Expect no match
  3243. line one\nthis is a line\nbreak in the second line
  3244. /1234/
  3245. 123\=ps
  3246. \= Expect no match
  3247. a4\=ps,dfa_restart
  3248. /1234/
  3249. 123\=ps
  3250. 4\=ps,dfa_restart
  3251. /^/gm
  3252. a\nb\nc\n
  3253. \
  3254. /(?<=C\n)^/gm
  3255. A\nC\nC\n
  3256. /(?s)A?B/
  3257. AB
  3258. aB
  3259. /(?s)A*B/
  3260. AB
  3261. aB
  3262. /(?m)A?B/
  3263. AB
  3264. aB
  3265. /(?m)A*B/
  3266. AB
  3267. aB
  3268. /Content-Type\x3A[^\r\n]{6,}/
  3269. Content-Type:xxxxxyyy
  3270. /Content-Type\x3A[^\r\n]{6,}z/
  3271. Content-Type:xxxxxyyyz
  3272. /Content-Type\x3A[^a]{6,}/
  3273. Content-Type:xxxyyy
  3274. /Content-Type\x3A[^a]{6,}z/
  3275. Content-Type:xxxyyyz
  3276. /^abc/Im,newline=lf
  3277. xyz\nabc
  3278. xyz\r\nabc
  3279. \= Expect no match
  3280. xyz\rabc
  3281. xyzabc\r
  3282. xyzabc\rpqr
  3283. xyzabc\r\n
  3284. xyzabc\r\npqr
  3285. /^abc/Im,newline=crlf
  3286. xyz\r\nabclf>
  3287. \= Expect no match
  3288. xyz\nabclf
  3289. xyz\rabclf
  3290. /^abc/Im,newline=cr
  3291. xyz\rabc
  3292. \= Expect no match
  3293. xyz\nabc
  3294. xyz\r\nabc
  3295. /.*/I,newline=lf
  3296. abc\ndef
  3297. abc\rdef
  3298. abc\r\ndef
  3299. /.*/I,newline=cr
  3300. abc\ndef
  3301. abc\rdef
  3302. abc\r\ndef
  3303. /.*/I,newline=crlf
  3304. abc\ndef
  3305. abc\rdef
  3306. abc\r\ndef
  3307. /\w+(.)(.)?def/Is
  3308. abc\ndef
  3309. abc\rdef
  3310. abc\r\ndef
  3311. /\w+(.)(.)?def/s
  3312. abc\ndef
  3313. abc\rdef
  3314. abc\r\ndef
  3315. /^\w+=.*(\\\n.*)*/
  3316. abc=xyz\\\npqr
  3317. /^(a()*)*/
  3318. aaaa
  3319. /^(?:a(?:(?:))*)*/
  3320. aaaa
  3321. /^(a()+)+/
  3322. aaaa
  3323. /^(?:a(?:(?:))+)+/
  3324. aaaa
  3325. /(a|)*\d/
  3326. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3327. \= Expect no match
  3328. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3329. /(?>a|)*\d/
  3330. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3331. \= Expect no match
  3332. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3333. /(?:a|)*\d/
  3334. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3335. \= Expect no match
  3336. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3337. /^a.b/newline=lf
  3338. a\rb
  3339. \= Expect no match
  3340. a\nb
  3341. /^a.b/newline=cr
  3342. a\nb
  3343. \= Expect no match
  3344. a\rb
  3345. /^a.b/newline=anycrlf
  3346. a\x85b
  3347. \= Expect no match
  3348. a\rb
  3349. /^a.b/newline=any
  3350. \= Expect no match
  3351. a\nb
  3352. a\rb
  3353. a\x85b
  3354. /^abc./gmx,newline=any
  3355. abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
  3356. /abc.$/gmx,newline=any
  3357. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
  3358. /^a\Rb/bsr=unicode
  3359. a\nb
  3360. a\rb
  3361. a\r\nb
  3362. a\x0bb
  3363. a\x0cb
  3364. a\x85b
  3365. \= Expect no match
  3366. a\n\rb
  3367. /^a\R*b/bsr=unicode
  3368. ab
  3369. a\nb
  3370. a\rb
  3371. a\r\nb
  3372. a\x0bb
  3373. a\x0cb
  3374. a\x85b
  3375. a\n\rb
  3376. a\n\r\x85\x0cb
  3377. /^a\R+b/bsr=unicode
  3378. a\nb
  3379. a\rb
  3380. a\r\nb
  3381. a\x0bb
  3382. a\x0cb
  3383. a\x85b
  3384. a\n\rb
  3385. a\n\r\x85\x0cb
  3386. \= Expect no match
  3387. ab
  3388. /^a\R{1,3}b/bsr=unicode
  3389. a\nb
  3390. a\n\rb
  3391. a\n\r\x85b
  3392. a\r\n\r\nb
  3393. a\r\n\r\n\r\nb
  3394. a\n\r\n\rb
  3395. a\n\n\r\nb
  3396. \= Expect no match
  3397. a\n\n\n\rb
  3398. a\r
  3399. /.+foo/
  3400. afoo
  3401. \= Expect no match
  3402. \r\nfoo
  3403. \nfoo
  3404. /.+foo/newline=crlf
  3405. afoo
  3406. \nfoo
  3407. \= Expect no match
  3408. \r\nfoo
  3409. /.+foo/newline=any
  3410. afoo
  3411. \= Expect no match
  3412. \nfoo
  3413. \r\nfoo
  3414. /.+foo/s
  3415. afoo
  3416. \r\nfoo
  3417. \nfoo
  3418. /^$/gm,newline=any
  3419. abc\r\rxyz
  3420. abc\n\rxyz
  3421. \= Expect no match
  3422. abc\r\nxyz
  3423. /^X/m
  3424. XABC
  3425. \= Expect no match
  3426. XABC\=notbol
  3427. /(?m)^$/g,newline=any,aftertext
  3428. abc\r\n\r\n
  3429. /(?m)^$|^\r\n/g,newline=any,aftertext
  3430. abc\r\n\r\n
  3431. /(?m)$/g,newline=any,aftertext
  3432. abc\r\n\r\n
  3433. /(?|(abc)|(xyz))/
  3434. >abc<
  3435. >xyz<
  3436. /(x)(?|(abc)|(xyz))(x)/
  3437. xabcx
  3438. xxyzx
  3439. /(x)(?|(abc)(pqr)|(xyz))(x)/
  3440. xabcpqrx
  3441. xxyzx
  3442. /(?|(abc)|(xyz))(?1)/
  3443. abcabc
  3444. xyzabc
  3445. \= Expect no match
  3446. xyzxyz
  3447. /\H\h\V\v/
  3448. X X\x0a
  3449. X\x09X\x0b
  3450. \= Expect no match
  3451. \xa0 X\x0a
  3452. /\H*\h+\V?\v{3,4}/
  3453. \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
  3454. \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
  3455. \x09\x20\xa0\x0a\x0b\x0c
  3456. \= Expect no match
  3457. \x09\x20\xa0\x0a\x0b
  3458. /\H{3,4}/
  3459. XY ABCDE
  3460. XY PQR ST
  3461. /.\h{3,4}./
  3462. XY AB PQRS
  3463. /\h*X\h?\H+Y\H?Z/
  3464. >XNNNYZ
  3465. > X NYQZ
  3466. \= Expect no match
  3467. >XYZ
  3468. > X NY Z
  3469. /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
  3470. >XY\x0aZ\x0aA\x0bNN\x0c
  3471. >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
  3472. /.+A/newline=crlf
  3473. \= Expect no match
  3474. \r\nA
  3475. /\nA/newline=crlf
  3476. \r\nA
  3477. /[\r\n]A/newline=crlf
  3478. \r\nA
  3479. /(\r|\n)A/newline=crlf
  3480. \r\nA
  3481. /a\Rb/I,bsr=anycrlf
  3482. a\rb
  3483. a\nb
  3484. a\r\nb
  3485. \= Expect no match
  3486. a\x85b
  3487. a\x0bb
  3488. /a\Rb/I,bsr=unicode
  3489. a\rb
  3490. a\nb
  3491. a\r\nb
  3492. a\x85b
  3493. a\x0bb
  3494. /a\R?b/I,bsr=anycrlf
  3495. a\rb
  3496. a\nb
  3497. a\r\nb
  3498. \= Expect no match
  3499. a\x85b
  3500. a\x0bb
  3501. /a\R?b/I,bsr=unicode
  3502. a\rb
  3503. a\nb
  3504. a\r\nb
  3505. a\x85b
  3506. a\x0bb
  3507. /a\R{2,4}b/I,bsr=anycrlf
  3508. a\r\n\nb
  3509. a\n\r\rb
  3510. a\r\n\r\n\r\n\r\nb
  3511. \= Expect no match
  3512. a\x0b\x0bb
  3513. a\x85\x85b
  3514. /a\R{2,4}b/I,bsr=unicode
  3515. a\r\rb
  3516. a\n\n\nb
  3517. a\r\n\n\r\rb
  3518. a\x85\x85b
  3519. a\x0b\x0bb
  3520. \= Expect no match
  3521. a\r\r\r\r\rb
  3522. /a(?!)|\wbc/
  3523. abc
  3524. /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  3525. \= Expect no match
  3526. ab
  3527. /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  3528. \= Expect no match
  3529. ab
  3530. /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  3531. \= Expect no match
  3532. ab
  3533. /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  3534. aXb
  3535. a\nb
  3536. \= Expect no match
  3537. ab
  3538. /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  3539. aXb
  3540. a\nX\nXb
  3541. \= Expect no match
  3542. ab
  3543. /X$/dollar_endonly
  3544. X
  3545. \= Expect no match
  3546. X\n
  3547. /X$/
  3548. X
  3549. X\n
  3550. /xyz/auto_callout
  3551. xyz
  3552. abcxyz
  3553. \= Expect no match
  3554. abc
  3555. abcxypqr
  3556. /xyz/auto_callout,no_start_optimize
  3557. abcxyz
  3558. \= Expect no match
  3559. abc
  3560. abcxypqr
  3561. /(*NO_START_OPT)xyz/auto_callout
  3562. abcxyz
  3563. /(?C)ab/
  3564. ab
  3565. ab\=callout_none
  3566. /ab/auto_callout
  3567. ab
  3568. ab\=callout_none
  3569. /^"((?(?=[a])[^"])|b)*"$/auto_callout
  3570. "ab"
  3571. "ab"\=callout_none
  3572. /\d+X|9+Y/
  3573. ++++123999\=ps
  3574. ++++123999Y\=ps
  3575. /Z(*F)/
  3576. \= Expect no match
  3577. Z\=ps
  3578. ZA\=ps
  3579. /Z(?!)/
  3580. \= Expect no match
  3581. Z\=ps
  3582. ZA\=ps
  3583. /dog(sbody)?/
  3584. dogs\=ps
  3585. dogs\=ph
  3586. /dog(sbody)??/
  3587. dogs\=ps
  3588. dogs\=ph
  3589. /dog|dogsbody/
  3590. dogs\=ps
  3591. dogs\=ph
  3592. /dogsbody|dog/
  3593. dogs\=ps
  3594. dogs\=ph
  3595. /Z(*F)Q|ZXY/
  3596. Z\=ps
  3597. \= Expect no match
  3598. ZA\=ps
  3599. X\=ps
  3600. /\bthe cat\b/
  3601. the cat\=ps
  3602. the cat\=ph
  3603. /dog(sbody)?/
  3604. dogs\=ps
  3605. body\=dfa_restart
  3606. /dog(sbody)?/
  3607. dogs\=ph
  3608. body\=dfa_restart
  3609. /abc/
  3610. abc\=ps
  3611. abc\=ph
  3612. /abc\K123/
  3613. xyzabc123pqr
  3614. /(?<=abc)123/allusedtext
  3615. xyzabc123pqr
  3616. xyzabc12\=ps
  3617. xyzabc12\=ph
  3618. /\babc\b/allusedtext
  3619. +++abc+++
  3620. +++ab\=ps
  3621. +++ab\=ph
  3622. /(?=C)/g,aftertext
  3623. ABCDECBA
  3624. /(abc|def|xyz)/I
  3625. terhjk;abcdaadsfe
  3626. the quick xyz brown fox
  3627. \= Expect no match
  3628. thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
  3629. /(abc|def|xyz)/I,no_start_optimize
  3630. terhjk;abcdaadsfe
  3631. the quick xyz brown fox
  3632. \= Expect no match
  3633. thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
  3634. /abcd*/aftertext
  3635. xxxxabcd\=ps
  3636. xxxxabcd\=ph
  3637. dddxxx\=dfa_restart
  3638. xxxxabcd\=ph
  3639. xxx\=dfa_restart
  3640. /abcd*/i
  3641. xxxxabcd\=ps
  3642. xxxxabcd\=ph
  3643. XXXXABCD\=ps
  3644. XXXXABCD\=ph
  3645. /abc\d*/
  3646. xxxxabc1\=ps
  3647. xxxxabc1\=ph
  3648. /abc[de]*/
  3649. xxxxabcde\=ps
  3650. xxxxabcde\=ph
  3651. /(?:(?1)|B)(A(*F)|C)/
  3652. ABCD
  3653. CCD
  3654. \= Expect no match
  3655. CAD
  3656. /^(?:(?1)|B)(A(*F)|C)/
  3657. CCD
  3658. BCD
  3659. \= Expect no match
  3660. ABCD
  3661. CAD
  3662. BAD
  3663. /^(?!a(*SKIP)b)/
  3664. ac
  3665. /^(?=a(*SKIP)b|ac)/
  3666. ac
  3667. /^(?=a(*THEN)b|ac)/
  3668. ac
  3669. /^(?=a(*PRUNE)b)/
  3670. ab
  3671. /^(?(?!a(*SKIP)b))/
  3672. ac
  3673. /(?<=abc)def/allusedtext
  3674. abc\=ph
  3675. /abc$/
  3676. abc
  3677. abc\=ps
  3678. abc\=ph
  3679. /abc$/m
  3680. abc
  3681. abc\n
  3682. abc\=ph
  3683. abc\n\=ph
  3684. abc\=ps
  3685. abc\n\=ps
  3686. /abc\z/
  3687. abc
  3688. abc\=ps
  3689. abc\=ph
  3690. /abc\Z/
  3691. abc
  3692. abc\=ps
  3693. abc\=ph
  3694. /abc\b/
  3695. abc
  3696. abc\=ps
  3697. abc\=ph
  3698. /abc\B/
  3699. abc\=ps
  3700. abc\=ph
  3701. \= Expect no match
  3702. abc
  3703. /.+/
  3704. abc\=offset=0
  3705. abc\=offset=1
  3706. abc\=offset=2
  3707. \= Bad offsets
  3708. abc\=offset=4
  3709. abc\=offset=-4
  3710. \= Expect no match
  3711. abc\=offset=3
  3712. /^(?:a)++\w/
  3713. aaaab
  3714. \= Expect no match
  3715. aaaa
  3716. bbb
  3717. /^(?:aa|(?:a)++\w)/
  3718. aaaab
  3719. aaaa
  3720. \= Expect no match
  3721. bbb
  3722. /^(?:a)*+\w/
  3723. aaaab
  3724. bbb
  3725. \= Expect no match
  3726. aaaa
  3727. /^(a)++\w/
  3728. aaaab
  3729. \= Expect no match
  3730. aaaa
  3731. bbb
  3732. /^(a|)++\w/
  3733. aaaab
  3734. \= Expect no match
  3735. aaaa
  3736. bbb
  3737. /(?=abc){3}abc/aftertext
  3738. abcabcabc
  3739. \= Expect no match
  3740. xyz
  3741. /(?=abc)+abc/aftertext
  3742. abcabcabc
  3743. \= Expect no match
  3744. xyz
  3745. /(?=abc)++abc/aftertext
  3746. abcabcabc
  3747. \= Expect no match
  3748. xyz
  3749. /(?=abc){0}xyz/
  3750. xyz
  3751. /(?=abc){1}xyz/
  3752. \= Expect no match
  3753. xyz
  3754. /(?=(a))?./
  3755. ab
  3756. bc
  3757. /(?=(a))??./
  3758. ab
  3759. bc
  3760. /^(?=(a)){0}b(?1)/
  3761. backgammon
  3762. /^(?=(?1))?[az]([abc])d/
  3763. abd
  3764. zcdxx
  3765. /^(?!a){0}\w+/
  3766. aaaaa
  3767. /(?<=(abc))?xyz/
  3768. abcxyz
  3769. pqrxyz
  3770. /((?2))((?1))/
  3771. abc
  3772. /(?(R)a+|(?R)b)/
  3773. aaaabcde
  3774. /(?(R)a+|((?R))b)/
  3775. aaaabcde
  3776. /((?(R)a+|(?1)b))/
  3777. aaaabcde
  3778. /((?(R2)a+|(?1)b))()/
  3779. aaaabcde
  3780. /(?(R)a*(?1)|((?R))b)/
  3781. aaaabcde
  3782. /(a+)/no_auto_possess
  3783. aaaa\=ovector=3
  3784. aaaa\=ovector=4
  3785. /^\R/
  3786. \r\=ps
  3787. \r\=ph
  3788. /^\R{2,3}x/
  3789. \r\=ps
  3790. \r\=ph
  3791. \r\r\=ps
  3792. \r\r\=ph
  3793. \r\r\r\=ps
  3794. \r\r\r\=ph
  3795. \r\rx
  3796. \r\r\rx
  3797. /^\R{2,3}?x/
  3798. \r\=ps
  3799. \r\=ph
  3800. \r\r\=ps
  3801. \r\r\=ph
  3802. \r\r\r\=ps
  3803. \r\r\r\=ph
  3804. \r\rx
  3805. \r\r\rx
  3806. /^\R?x/
  3807. \r\=ps
  3808. \r\=ph
  3809. x
  3810. \rx
  3811. /^\R+x/
  3812. \r\=ps
  3813. \r\=ph
  3814. \r\n\=ps
  3815. \r\n\=ph
  3816. \rx
  3817. /^a$/newline=crlf
  3818. a\r\=ps
  3819. a\r\=ph
  3820. /^a$/m,newline=crlf
  3821. a\r\=ps
  3822. a\r\=ph
  3823. /^(a$|a\r)/newline=crlf
  3824. a\r\=ps
  3825. a\r\=ph
  3826. /^(a$|a\r)/m,newline=crlf
  3827. a\r\=ps
  3828. a\r\=ph
  3829. /./newline=crlf
  3830. \r\=ps
  3831. \r\=ph
  3832. /.{2,3}/newline=crlf
  3833. \r\=ps
  3834. \r\=ph
  3835. \r\r\=ps
  3836. \r\r\=ph
  3837. \r\r\r\=ps
  3838. \r\r\r\=ph
  3839. /.{2,3}?/newline=crlf
  3840. \r\=ps
  3841. \r\=ph
  3842. \r\r\=ps
  3843. \r\r\=ph
  3844. \r\r\r\=ps
  3845. \r\r\r\=ph
  3846. # Test simple validity check for restarts
  3847. /abcdef/
  3848. abc\=dfa_restart
  3849. /<H((?(?!<H|F>)(.)|(?R))++)*F>/
  3850. text <H more text <H texting more hexA0-"\xA0" hex above 7F-"\xBC" F> text xxxxx <H text F> text F> text2 <H text sample F> more text.
  3851. /^(?>.{4})abc|^\w\w.xabcd/
  3852. xxxxabcd
  3853. xx\xa0xabcd
  3854. /^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/
  3855. xxxxxxxxabcd
  3856. xx\xa0xxxxxabcd
  3857. /abcd/
  3858. abcd\=ovector=0
  3859. # These tests show up auto-possessification
  3860. /[ab]*/
  3861. aaaa
  3862. /[ab]*?/
  3863. aaaa
  3864. /[ab]?/
  3865. aaaa
  3866. /[ab]??/
  3867. aaaa
  3868. /[ab]+/
  3869. aaaa
  3870. /[ab]+?/
  3871. aaaa
  3872. /[ab]{2,3}/
  3873. aaaa
  3874. /[ab]{2,3}?/
  3875. aaaa
  3876. /[ab]{2,}/
  3877. aaaa
  3878. /[ab]{2,}?/
  3879. aaaa
  3880. '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
  3881. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  3882. '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
  3883. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  3884. /abc(?=xyz)/allusedtext
  3885. abcxyzpqr
  3886. abcxyzpqr\=aftertext
  3887. /(?<=pqr)abc(?=xyz)/allusedtext
  3888. xyzpqrabcxyzpqr
  3889. xyzpqrabcxyzpqr\=aftertext
  3890. /a\b/
  3891. a.\=allusedtext
  3892. a\=allusedtext
  3893. /abc(?=abcde)(?=ab)/allusedtext
  3894. abcabcdefg
  3895. /a*?b*?/
  3896. ab
  3897. /(*NOTEMPTY)a*?b*?/
  3898. ab
  3899. ba
  3900. cb
  3901. /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
  3902. ab
  3903. cdab
  3904. /(a)(b)|(c)/
  3905. XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
  3906. /(?<A>aa)/
  3907. aa\=get=A
  3908. aa\=copy=A
  3909. /a+/no_auto_possess
  3910. a\=ovector=2,get=1,get=2,getall
  3911. aaa\=ovector=2,get=1,get=2,getall
  3912. /a(b)c(d)/
  3913. abc\=ph,copy=0,copy=1,getall
  3914. /ab(?C" any text with spaces ")cde/B
  3915. abcde
  3916. 12abcde
  3917. /^a(b)c(?C1)def/
  3918. abcdef
  3919. /^a(b)c(?C"AB")def/
  3920. abcdef
  3921. /^a(b)c(?C1)def/
  3922. abcdef\=callout_capture
  3923. /^a(b)c(?C{AB})def/B
  3924. abcdef\=callout_capture
  3925. /^(?(?C25)(?=abc)abcd|xyz)/B
  3926. abcdefg
  3927. xyz123
  3928. /^(?(?C$abc$)(?=abc)abcd|xyz)/B
  3929. abcdefg
  3930. xyz123
  3931. /^ab(?C'first')cd(?C"second")ef/
  3932. abcdefg
  3933. /(?:a(?C`code`)){3}X/
  3934. aaaXY
  3935. # Binary zero in callout string
  3936. /"a(?C'x" 00 "z')b"/hex
  3937. abcdefgh
  3938. /(?(?!)a|b)/
  3939. bbb
  3940. \= Expect no match
  3941. aaa
  3942. /^/gm
  3943. \n\n\n
  3944. /^/gm,alt_circumflex
  3945. \n\n\n
  3946. /abc/use_offset_limit
  3947. 1234abcde\=offset_limit=100
  3948. 1234abcde\=offset_limit=9
  3949. 1234abcde\=offset_limit=4
  3950. 1234abcde\=offset_limit=4,offset=4
  3951. \= Expect no match
  3952. 1234abcde\=offset_limit=4,offset=5
  3953. 1234abcde\=offset_limit=3
  3954. /(?<=abc)/use_offset_limit
  3955. 1234abc\=offset_limit=7
  3956. \= Expect no match
  3957. 1234abc\=offset_limit=6
  3958. /abcd/null_context
  3959. abcd\=null_context
  3960. /()()a+/no_auto_possess
  3961. aaa\=allcaptures
  3962. a\=allcaptures
  3963. /(*LIMIT_DEPTH=100)^((.)(?1)|.)$/
  3964. \= Expect depth limit exceeded
  3965. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  3966. /(*LIMIT_HEAP=0)^((.)(?1)|.)$/
  3967. \= Expect heap limit exceeded
  3968. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  3969. /(*LIMIT_HEAP=50000)^((.)(?1)|.)$/
  3970. \= Expect success
  3971. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  3972. /(02-)?[0-9]{3}-[0-9]{3}/
  3973. 02-123-123
  3974. /^(a(?2))(b)(?1)/
  3975. abbab\=find_limits
  3976. /abc/endanchored
  3977. xyzabc
  3978. \= Expect no match
  3979. xyzabcdef
  3980. \= Expect error
  3981. xyzabc\=ph
  3982. /abc/
  3983. xyzabc\=endanchored
  3984. \= Expect no match
  3985. xyzabcdef\=endanchored
  3986. \= Expect error
  3987. xyzabc\=ps,endanchored
  3988. /abc|bcd/endanchored
  3989. xyzabcd
  3990. \= Expect no match
  3991. xyzabcdef
  3992. /(*NUL)^.*/
  3993. a\nb\x00ccc
  3994. /(*NUL)^.*/s
  3995. a\nb\x00ccc
  3996. /^x/m,newline=nul
  3997. ab\x00xy
  3998. /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
  3999. x\nyz
  4000. /(*NUL)^X\NY/
  4001. X\nY
  4002. X\rY
  4003. \= Expect no match
  4004. X\x00Y
  4005. /(?<=abc|)/
  4006. abcde\=aftertext
  4007. /(?<=|abc)/
  4008. abcde\=aftertext
  4009. /(?<=abc|)/endanchored
  4010. abcde\=aftertext
  4011. /(?<=|abc)/endanchored
  4012. abcde\=aftertext
  4013. /(*LIMIT_MATCH=100).*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00 \x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););/no_dotstar_anchor
  4014. \= Expect limit exceeded
  4015. .*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00 \x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););
  4016. /\n/firstline
  4017. xyz\nabc
  4018. /\nabc/firstline
  4019. xyz\nabc
  4020. /\x{0a}abc/firstline,newline=crlf
  4021. \= Expect no match
  4022. xyz\r\nabc
  4023. /[abc]/firstline
  4024. \= Expect no match
  4025. \na
  4026. /foobar/
  4027. the foobar thing\=copy_matched_subject
  4028. the foobar thing\=copy_matched_subject,zero_terminate
  4029. /foobar/g
  4030. the foobar thing foobar again\=copy_matched_subject
  4031. /(?(VERSION>=0)^B0W)/
  4032. B0W-W0W
  4033. \= Expect no match
  4034. 0
  4035. /(?(VERSION>=1000)^B0W|W0W)/
  4036. B0W-W0W
  4037. \= Expect no match
  4038. 0
  4039. /(?<=pqr)abc(?=xyz)/
  4040. 123pqrabcxy\=ps,allusedtext
  4041. 123pqrabcxyz\=ps,allusedtext
  4042. /(?>a+b)/
  4043. aaaa\=ps
  4044. aaaab\=ps
  4045. /(abc)(?1)/
  4046. abca\=ps
  4047. abcabc\=ps
  4048. /(?(?=abc).*|Z)/
  4049. ab\=ps
  4050. abcxyz\=ps
  4051. /(abc)++x/
  4052. abcab\=ps
  4053. abc\=ps
  4054. ab\=ps
  4055. abcx
  4056. /\z/
  4057. abc\=ph
  4058. abc\=ps
  4059. /\Z/
  4060. abc\=ph
  4061. abc\=ps
  4062. abc\n\=ph
  4063. abc\n\=ps
  4064. /c*+(?<=[bc])/
  4065. abc\=ph
  4066. ab\=ph
  4067. abc\=ps
  4068. ab\=ps
  4069. /c++(?<=[bc])/
  4070. abc\=ph
  4071. ab\=ph
  4072. /(?<=(?=.(?<=x)))/
  4073. abx
  4074. ab\=ph
  4075. bxyz
  4076. xyz
  4077. /(?![ab]).*/
  4078. ab\=ph
  4079. /c*+/
  4080. ab\=ph,offset=2
  4081. /
  4082. /anchored, firstline
  4083. \x0a
  4084. /
  4085. /anchored,firstline,no_start_optimize
  4086. \x0a
  4087. /
  4088. /firstline
  4089. \x0a
  4090. abc\x0adef
  4091. /|a(?0)/endanchored
  4092. aaaa
  4093. # End of testinput6