/vendor/pcre/testdata/testoutput7

http://github.com/feyeleanor/RubyGoLightly · #! · 7257 lines · 6464 code · 793 blank · 0 comment · 0 complexity · 9c72a53ebadbc73f1eff5e8466fcef62 MD5 · raw file

Large files are truncated click here to view the full file

  1. /abc/
  2. abc
  3. 0: abc
  4. /ab*c/
  5. abc
  6. 0: abc
  7. abbbbc
  8. 0: abbbbc
  9. ac
  10. 0: ac
  11. /ab+c/
  12. abc
  13. 0: abc
  14. abbbbbbc
  15. 0: abbbbbbc
  16. *** Failers
  17. No match
  18. ac
  19. No match
  20. ab
  21. No match
  22. /a*/
  23. a
  24. 0: a
  25. 1:
  26. aaaaaaaaaaaaaaaaa
  27. 0: aaaaaaaaaaaaaaaaa
  28. 1: aaaaaaaaaaaaaaaa
  29. 2: aaaaaaaaaaaaaaa
  30. 3: aaaaaaaaaaaaaa
  31. 4: aaaaaaaaaaaaa
  32. 5: aaaaaaaaaaaa
  33. 6: aaaaaaaaaaa
  34. 7: aaaaaaaaaa
  35. 8: aaaaaaaaa
  36. 9: aaaaaaaa
  37. 10: aaaaaaa
  38. 11: aaaaaa
  39. 12: aaaaa
  40. 13: aaaa
  41. 14: aaa
  42. 15: aa
  43. 16: a
  44. 17:
  45. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  46. Matched, but too many subsidiary matches
  47. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  48. 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  49. 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa
  50. 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa
  51. 4: aaaaaaaaaaaaaaaaaaaaaaaaaa
  52. 5: aaaaaaaaaaaaaaaaaaaaaaaaa
  53. 6: aaaaaaaaaaaaaaaaaaaaaaaa
  54. 7: aaaaaaaaaaaaaaaaaaaaaaa
  55. 8: aaaaaaaaaaaaaaaaaaaaaa
  56. 9: aaaaaaaaaaaaaaaaaaaaa
  57. 10: aaaaaaaaaaaaaaaaaaaa
  58. 11: aaaaaaaaaaaaaaaaaaa
  59. 12: aaaaaaaaaaaaaaaaaa
  60. 13: aaaaaaaaaaaaaaaaa
  61. 14: aaaaaaaaaaaaaaaa
  62. 15: aaaaaaaaaaaaaaa
  63. 16: aaaaaaaaaaaaaa
  64. 17: aaaaaaaaaaaaa
  65. 18: aaaaaaaaaaaa
  66. 19: aaaaaaaaaaa
  67. 20: aaaaaaaaaa
  68. 21: aaaaaaaaa
  69. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F
  70. 0:
  71. /(a|abcd|african)/
  72. a
  73. 0: a
  74. abcd
  75. 0: abcd
  76. 1: a
  77. african
  78. 0: african
  79. 1: a
  80. /^abc/
  81. abcdef
  82. 0: abc
  83. *** Failers
  84. No match
  85. xyzabc
  86. No match
  87. xyz\nabc
  88. No match
  89. /^abc/m
  90. abcdef
  91. 0: abc
  92. xyz\nabc
  93. 0: abc
  94. *** Failers
  95. No match
  96. xyzabc
  97. No match
  98. /\Aabc/
  99. abcdef
  100. 0: abc
  101. *** Failers
  102. No match
  103. xyzabc
  104. No match
  105. xyz\nabc
  106. No match
  107. /\Aabc/m
  108. abcdef
  109. 0: abc
  110. *** Failers
  111. No match
  112. xyzabc
  113. No match
  114. xyz\nabc
  115. No match
  116. /\Gabc/
  117. abcdef
  118. 0: abc
  119. xyzabc\>3
  120. 0: abc
  121. *** Failers
  122. No match
  123. xyzabc
  124. No match
  125. xyzabc\>2
  126. No match
  127. /x\dy\Dz/
  128. x9yzz
  129. 0: x9yzz
  130. x0y+z
  131. 0: x0y+z
  132. *** Failers
  133. No match
  134. xyz
  135. No match
  136. xxy0z
  137. No match
  138. /x\sy\Sz/
  139. x yzz
  140. 0: x yzz
  141. x y+z
  142. 0: x y+z
  143. *** Failers
  144. No match
  145. xyz
  146. No match
  147. xxyyz
  148. No match
  149. /x\wy\Wz/
  150. xxy+z
  151. 0: xxy+z
  152. *** Failers
  153. No match
  154. xxy0z
  155. No match
  156. x+y+z
  157. No match
  158. /x.y/
  159. x+y
  160. 0: x+y
  161. x-y
  162. 0: x-y
  163. *** Failers
  164. No match
  165. x\ny
  166. No match
  167. /x.y/s
  168. x+y
  169. 0: x+y
  170. x-y
  171. 0: x-y
  172. x\ny
  173. 0: x\x0ay
  174. /(a.b(?s)c.d|x.y)p.q/
  175. a+bc+dp+q
  176. 0: a+bc+dp+q
  177. a+bc\ndp+q
  178. 0: a+bc\x0adp+q
  179. x\nyp+q
  180. 0: x\x0ayp+q
  181. *** Failers
  182. No match
  183. a\nbc\ndp+q
  184. No match
  185. a+bc\ndp\nq
  186. No match
  187. x\nyp\nq
  188. No match
  189. /a\d\z/
  190. ba0
  191. 0: a0
  192. *** Failers
  193. No match
  194. ba0\n
  195. No match
  196. ba0\ncd
  197. No match
  198. /a\d\z/m
  199. ba0
  200. 0: a0
  201. *** Failers
  202. No match
  203. ba0\n
  204. No match
  205. ba0\ncd
  206. No match
  207. /a\d\Z/
  208. ba0
  209. 0: a0
  210. ba0\n
  211. 0: a0
  212. *** Failers
  213. No match
  214. ba0\ncd
  215. No match
  216. /a\d\Z/m
  217. ba0
  218. 0: a0
  219. ba0\n
  220. 0: a0
  221. *** Failers
  222. No match
  223. ba0\ncd
  224. No match
  225. /a\d$/
  226. ba0
  227. 0: a0
  228. ba0\n
  229. 0: a0
  230. *** Failers
  231. No match
  232. ba0\ncd
  233. No match
  234. /a\d$/m
  235. ba0
  236. 0: a0
  237. ba0\n
  238. 0: a0
  239. ba0\ncd
  240. 0: a0
  241. *** Failers
  242. No match
  243. /abc/i
  244. abc
  245. 0: abc
  246. aBc
  247. 0: aBc
  248. ABC
  249. 0: ABC
  250. /[^a]/
  251. abcd
  252. 0: b
  253. /ab?\w/
  254. abz
  255. 0: abz
  256. 1: ab
  257. abbz
  258. 0: abb
  259. 1: ab
  260. azz
  261. 0: az
  262. /x{0,3}yz/
  263. ayzq
  264. 0: yz
  265. axyzq
  266. 0: xyz
  267. axxyz
  268. 0: xxyz
  269. axxxyzq
  270. 0: xxxyz
  271. axxxxyzq
  272. 0: xxxyz
  273. *** Failers
  274. No match
  275. ax
  276. No match
  277. axx
  278. No match
  279. /x{3}yz/
  280. axxxyzq
  281. 0: xxxyz
  282. axxxxyzq
  283. 0: xxxyz
  284. *** Failers
  285. No match
  286. ax
  287. No match
  288. axx
  289. No match
  290. ayzq
  291. No match
  292. axyzq
  293. No match
  294. axxyz
  295. No match
  296. /x{2,3}yz/
  297. axxyz
  298. 0: xxyz
  299. axxxyzq
  300. 0: xxxyz
  301. axxxxyzq
  302. 0: xxxyz
  303. *** Failers
  304. No match
  305. ax
  306. No match
  307. axx
  308. No match
  309. ayzq
  310. No match
  311. axyzq
  312. No match
  313. /[^a]+/
  314. bac
  315. 0: b
  316. bcdefax
  317. 0: bcdef
  318. 1: bcde
  319. 2: bcd
  320. 3: bc
  321. 4: b
  322. *** Failers
  323. 0: *** F
  324. 1: ***
  325. 2: ***
  326. 3: **
  327. 4: *
  328. aaaaa
  329. No match
  330. /[^a]*/
  331. bac
  332. 0: b
  333. 1:
  334. bcdefax
  335. 0: bcdef
  336. 1: bcde
  337. 2: bcd
  338. 3: bc
  339. 4: b
  340. 5:
  341. *** Failers
  342. 0: *** F
  343. 1: ***
  344. 2: ***
  345. 3: **
  346. 4: *
  347. 5:
  348. aaaaa
  349. 0:
  350. /[^a]{3,5}/
  351. xyz
  352. 0: xyz
  353. awxyza
  354. 0: wxyz
  355. 1: wxy
  356. abcdefa
  357. 0: bcdef
  358. 1: bcde
  359. 2: bcd
  360. abcdefghijk
  361. 0: bcdef
  362. 1: bcde
  363. 2: bcd
  364. *** Failers
  365. 0: *** F
  366. 1: ***
  367. 2: ***
  368. axya
  369. No match
  370. axa
  371. No match
  372. aaaaa
  373. No match
  374. /\d*/
  375. 1234b567
  376. 0: 1234
  377. 1: 123
  378. 2: 12
  379. 3: 1
  380. 4:
  381. xyz
  382. 0:
  383. /\D*/
  384. a1234b567
  385. 0: a
  386. 1:
  387. xyz
  388. 0: xyz
  389. 1: xy
  390. 2: x
  391. 3:
  392. /\d+/
  393. ab1234c56
  394. 0: 1234
  395. 1: 123
  396. 2: 12
  397. 3: 1
  398. *** Failers
  399. No match
  400. xyz
  401. No match
  402. /\D+/
  403. ab123c56
  404. 0: ab
  405. 1: a
  406. *** Failers
  407. 0: *** Failers
  408. 1: *** Failer
  409. 2: *** Faile
  410. 3: *** Fail
  411. 4: *** Fai
  412. 5: *** Fa
  413. 6: *** F
  414. 7: ***
  415. 8: ***
  416. 9: **
  417. 10: *
  418. 789
  419. No match
  420. /\d?A/
  421. 045ABC
  422. 0: 5A
  423. ABC
  424. 0: A
  425. *** Failers
  426. No match
  427. XYZ
  428. No match
  429. /\D?A/
  430. ABC
  431. 0: A
  432. BAC
  433. 0: BA
  434. 9ABC
  435. 0: A
  436. *** Failers
  437. No match
  438. /a+/
  439. aaaa
  440. 0: aaaa
  441. 1: aaa
  442. 2: aa
  443. 3: a
  444. /^.*xyz/
  445. xyz
  446. 0: xyz
  447. ggggggggxyz
  448. 0: ggggggggxyz
  449. /^.+xyz/
  450. abcdxyz
  451. 0: abcdxyz
  452. axyz
  453. 0: axyz
  454. *** Failers
  455. No match
  456. xyz
  457. No match
  458. /^.?xyz/
  459. xyz
  460. 0: xyz
  461. cxyz
  462. 0: cxyz
  463. /^\d{2,3}X/
  464. 12X
  465. 0: 12X
  466. 123X
  467. 0: 123X
  468. *** Failers
  469. No match
  470. X
  471. No match
  472. 1X
  473. No match
  474. 1234X
  475. No match
  476. /^[abcd]\d/
  477. a45
  478. 0: a4
  479. b93
  480. 0: b9
  481. c99z
  482. 0: c9
  483. d04
  484. 0: d0
  485. *** Failers
  486. No match
  487. e45
  488. No match
  489. abcd
  490. No match
  491. abcd1234
  492. No match
  493. 1234
  494. No match
  495. /^[abcd]*\d/
  496. a45
  497. 0: a4
  498. b93
  499. 0: b9
  500. c99z
  501. 0: c9
  502. d04
  503. 0: d0
  504. abcd1234
  505. 0: abcd1
  506. 1234
  507. 0: 1
  508. *** Failers
  509. No match
  510. e45
  511. No match
  512. abcd
  513. No match
  514. /^[abcd]+\d/
  515. a45
  516. 0: a4
  517. b93
  518. 0: b9
  519. c99z
  520. 0: c9
  521. d04
  522. 0: d0
  523. abcd1234
  524. 0: abcd1
  525. *** Failers
  526. No match
  527. 1234
  528. No match
  529. e45
  530. No match
  531. abcd
  532. No match
  533. /^a+X/
  534. aX
  535. 0: aX
  536. aaX
  537. 0: aaX
  538. /^[abcd]?\d/
  539. a45
  540. 0: a4
  541. b93
  542. 0: b9
  543. c99z
  544. 0: c9
  545. d04
  546. 0: d0
  547. 1234
  548. 0: 1
  549. *** Failers
  550. No match
  551. abcd1234
  552. No match
  553. e45
  554. No match
  555. /^[abcd]{2,3}\d/
  556. ab45
  557. 0: ab4
  558. bcd93
  559. 0: bcd9
  560. *** Failers
  561. No match
  562. 1234
  563. No match
  564. a36
  565. No match
  566. abcd1234
  567. No match
  568. ee45
  569. No match
  570. /^(abc)*\d/
  571. abc45
  572. 0: abc4
  573. abcabcabc45
  574. 0: abcabcabc4
  575. 42xyz
  576. 0: 4
  577. *** Failers
  578. No match
  579. /^(abc)+\d/
  580. abc45
  581. 0: abc4
  582. abcabcabc45
  583. 0: abcabcabc4
  584. *** Failers
  585. No match
  586. 42xyz
  587. No match
  588. /^(abc)?\d/
  589. abc45
  590. 0: abc4
  591. 42xyz
  592. 0: 4
  593. *** Failers
  594. No match
  595. abcabcabc45
  596. No match
  597. /^(abc){2,3}\d/
  598. abcabc45
  599. 0: abcabc4
  600. abcabcabc45
  601. 0: abcabcabc4
  602. *** Failers
  603. No match
  604. abcabcabcabc45
  605. No match
  606. abc45
  607. No match
  608. 42xyz
  609. No match
  610. /1(abc|xyz)2(?1)3/
  611. 1abc2abc3456
  612. 0: 1abc2abc3
  613. 1abc2xyz3456
  614. 0: 1abc2xyz3
  615. /^(a*\w|ab)=(a*\w|ab)/
  616. ab=ab
  617. 0: ab=ab
  618. 1: ab=a
  619. /^(a*\w|ab)=(?1)/
  620. ab=ab
  621. 0: ab=ab
  622. /^([^()]|\((?1)*\))*$/
  623. abc
  624. 0: abc
  625. a(b)c
  626. 0: a(b)c
  627. a(b(c))d
  628. 0: a(b(c))d
  629. *** Failers)
  630. No match
  631. a(b(c)d
  632. No match
  633. /^>abc>([^()]|\((?1)*\))*<xyz<$/
  634. >abc>123<xyz<
  635. 0: >abc>123<xyz<
  636. >abc>1(2)3<xyz<
  637. 0: >abc>1(2)3<xyz<
  638. >abc>(1(2)3)<xyz<
  639. 0: >abc>(1(2)3)<xyz<
  640. /^(?>a*)\d/
  641. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
  642. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9
  643. *** Failers
  644. No match
  645. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  646. No match
  647. /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x
  648. <>
  649. 0: <>
  650. <abcd>
  651. 0: <abcd>
  652. <abc <123> hij>
  653. 0: <abc <123> hij>
  654. <abc <def> hij>
  655. 0: <def>
  656. <abc<>def>
  657. 0: <abc<>def>
  658. <abc<>
  659. 0: <>
  660. *** Failers
  661. No match
  662. <abc
  663. No match
  664. /^(?(?=abc)\w{3}:|\d\d)$/
  665. abc:
  666. 0: abc:
  667. 12
  668. 0: 12
  669. *** Failers
  670. No match
  671. 123
  672. No match
  673. xyz
  674. No match
  675. /^(?(?!abc)\d\d|\w{3}:)$/
  676. abc:
  677. 0: abc:
  678. 12
  679. 0: 12
  680. *** Failers
  681. No match
  682. 123
  683. No match
  684. xyz
  685. No match
  686. /^(?=abc)\w{5}:$/
  687. abcde:
  688. 0: abcde:
  689. *** Failers
  690. No match
  691. abc..
  692. No match
  693. 123
  694. No match
  695. vwxyz
  696. No match
  697. /^(?!abc)\d\d$/
  698. 12
  699. 0: 12
  700. *** Failers
  701. No match
  702. abcde:
  703. No match
  704. abc..
  705. No match
  706. 123
  707. No match
  708. vwxyz
  709. No match
  710. /(?<=abc|xy)123/
  711. abc12345
  712. 0: 123
  713. wxy123z
  714. 0: 123
  715. *** Failers
  716. No match
  717. 123abc
  718. No match
  719. /(?<!abc|xy)123/
  720. 123abc
  721. 0: 123
  722. mno123456
  723. 0: 123
  724. *** Failers
  725. No match
  726. abc12345
  727. No match
  728. wxy123z
  729. No match
  730. /abc(?C1)xyz/
  731. abcxyz
  732. --->abcxyz
  733. 1 ^ ^ x
  734. 0: abcxyz
  735. 123abcxyz999
  736. --->123abcxyz999
  737. 1 ^ ^ x
  738. 0: abcxyz
  739. /(ab|cd){3,4}/C
  740. ababab
  741. --->ababab
  742. +0 ^ (ab|cd){3,4}
  743. +1 ^ a
  744. +4 ^ c
  745. +2 ^^ b
  746. +3 ^ ^ |
  747. +1 ^ ^ a
  748. +4 ^ ^ c
  749. +2 ^ ^ b
  750. +3 ^ ^ |
  751. +1 ^ ^ a
  752. +4 ^ ^ c
  753. +2 ^ ^ b
  754. +3 ^ ^ |
  755. +12 ^ ^
  756. +1 ^ ^ a
  757. +4 ^ ^ c
  758. 0: ababab
  759. abcdabcd
  760. --->abcdabcd
  761. +0 ^ (ab|cd){3,4}
  762. +1 ^ a
  763. +4 ^ c
  764. +2 ^^ b
  765. +3 ^ ^ |
  766. +1 ^ ^ a
  767. +4 ^ ^ c
  768. +5 ^ ^ d
  769. +6 ^ ^ )
  770. +1 ^ ^ a
  771. +4 ^ ^ c
  772. +2 ^ ^ b
  773. +3 ^ ^ |
  774. +12 ^ ^
  775. +1 ^ ^ a
  776. +4 ^ ^ c
  777. +5 ^ ^ d
  778. +6 ^ ^ )
  779. +12 ^ ^
  780. 0: abcdabcd
  781. 1: abcdab
  782. abcdcdcdcdcd
  783. --->abcdcdcdcdcd
  784. +0 ^ (ab|cd){3,4}
  785. +1 ^ a
  786. +4 ^ c
  787. +2 ^^ b
  788. +3 ^ ^ |
  789. +1 ^ ^ a
  790. +4 ^ ^ c
  791. +5 ^ ^ d
  792. +6 ^ ^ )
  793. +1 ^ ^ a
  794. +4 ^ ^ c
  795. +5 ^ ^ d
  796. +6 ^ ^ )
  797. +12 ^ ^
  798. +1 ^ ^ a
  799. +4 ^ ^ c
  800. +5 ^ ^ d
  801. +6 ^ ^ )
  802. +12 ^ ^
  803. 0: abcdcdcd
  804. 1: abcdcd
  805. /^abc/
  806. abcdef
  807. 0: abc
  808. *** Failers
  809. No match
  810. abcdef\B
  811. No match
  812. /^(a*|xyz)/
  813. bcd
  814. 0:
  815. aaabcd
  816. 0: aaa
  817. 1: aa
  818. 2: a
  819. 3:
  820. xyz
  821. 0: xyz
  822. 1:
  823. xyz\N
  824. 0: xyz
  825. *** Failers
  826. 0:
  827. bcd\N
  828. No match
  829. /xyz$/
  830. xyz
  831. 0: xyz
  832. xyz\n
  833. 0: xyz
  834. *** Failers
  835. No match
  836. xyz\Z
  837. No match
  838. xyz\n\Z
  839. No match
  840. /xyz$/m
  841. xyz
  842. 0: xyz
  843. xyz\n
  844. 0: xyz
  845. abcxyz\npqr
  846. 0: xyz
  847. abcxyz\npqr\Z
  848. 0: xyz
  849. xyz\n\Z
  850. 0: xyz
  851. *** Failers
  852. No match
  853. xyz\Z
  854. No match
  855. /\Gabc/
  856. abcdef
  857. 0: abc
  858. defabcxyz\>3
  859. 0: abc
  860. *** Failers
  861. No match
  862. defabcxyz
  863. No match
  864. /^abcdef/
  865. ab\P
  866. Partial match: ab
  867. abcde\P
  868. Partial match: abcde
  869. abcdef\P
  870. 0: abcdef
  871. *** Failers
  872. No match
  873. abx\P
  874. No match
  875. /^a{2,4}\d+z/
  876. a\P
  877. Partial match: a
  878. aa\P
  879. Partial match: aa
  880. aa2\P
  881. Partial match: aa2
  882. aaa\P
  883. Partial match: aaa
  884. aaa23\P
  885. Partial match: aaa23
  886. aaaa12345\P
  887. Partial match: aaaa12345
  888. aa0z\P
  889. 0: aa0z
  890. aaaa4444444444444z\P
  891. 0: aaaa4444444444444z
  892. *** Failers
  893. No match
  894. az\P
  895. No match
  896. aaaaa\P
  897. No match
  898. a56\P
  899. No match
  900. /^abcdef/
  901. abc\P
  902. Partial match: abc
  903. def\R
  904. 0: def
  905. /(?<=foo)bar/
  906. xyzfo\P
  907. No match
  908. foob\P\>2
  909. Partial match: b
  910. foobar...\R\P\>4
  911. 0: ar
  912. xyzfo\P
  913. No match
  914. foobar\>2
  915. 0: bar
  916. *** Failers
  917. No match
  918. xyzfo\P
  919. No match
  920. obar\R
  921. No match
  922. /(ab*(cd|ef))+X/
  923. adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z
  924. No match
  925. lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z
  926. Partial match: abbbbbbcdaefabbbbbbbefa
  927. cdabbbbbbbb\P\R\B\Z
  928. Partial match: cdabbbbbbbb
  929. efabbbbbbbbbbbbbbbb\P\R\B\Z
  930. Partial match: efabbbbbbbbbbbbbbbb
  931. bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z
  932. 0: bbbbbbbbbbbbcdX
  933. /(a|b)/SF>testsavedregex
  934. Compiled regex written to testsavedregex
  935. Study data written to testsavedregex
  936. <testsavedregex
  937. Compiled regex (byte-inverted) loaded from testsavedregex
  938. Study data loaded from testsavedregex
  939. abc
  940. 0: a
  941. ** Failers
  942. 0: a
  943. def
  944. No match
  945. /the quick brown fox/
  946. the quick brown fox
  947. 0: the quick brown fox
  948. The quick brown FOX
  949. No match
  950. What do you know about the quick brown fox?
  951. 0: the quick brown fox
  952. What do you know about THE QUICK BROWN FOX?
  953. No match
  954. /The quick brown fox/i
  955. the quick brown fox
  956. 0: the quick brown fox
  957. The quick brown FOX
  958. 0: The quick brown FOX
  959. What do you know about the quick brown fox?
  960. 0: the quick brown fox
  961. What do you know about THE QUICK BROWN FOX?
  962. 0: THE QUICK BROWN FOX
  963. /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
  964. abcd\t\n\r\f\a\e9;\$\\?caxyz
  965. 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz
  966. /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
  967. abxyzpqrrrabbxyyyypqAzz
  968. 0: abxyzpqrrrabbxyyyypqAzz
  969. abxyzpqrrrabbxyyyypqAzz
  970. 0: abxyzpqrrrabbxyyyypqAzz
  971. aabxyzpqrrrabbxyyyypqAzz
  972. 0: aabxyzpqrrrabbxyyyypqAzz
  973. aaabxyzpqrrrabbxyyyypqAzz
  974. 0: aaabxyzpqrrrabbxyyyypqAzz
  975. aaaabxyzpqrrrabbxyyyypqAzz
  976. 0: aaaabxyzpqrrrabbxyyyypqAzz
  977. abcxyzpqrrrabbxyyyypqAzz
  978. 0: abcxyzpqrrrabbxyyyypqAzz
  979. aabcxyzpqrrrabbxyyyypqAzz
  980. 0: aabcxyzpqrrrabbxyyyypqAzz
  981. aaabcxyzpqrrrabbxyyyypAzz
  982. 0: aaabcxyzpqrrrabbxyyyypAzz
  983. aaabcxyzpqrrrabbxyyyypqAzz
  984. 0: aaabcxyzpqrrrabbxyyyypqAzz
  985. aaabcxyzpqrrrabbxyyyypqqAzz
  986. 0: aaabcxyzpqrrrabbxyyyypqqAzz
  987. aaabcxyzpqrrrabbxyyyypqqqAzz
  988. 0: aaabcxyzpqrrrabbxyyyypqqqAzz
  989. aaabcxyzpqrrrabbxyyyypqqqqAzz
  990. 0: aaabcxyzpqrrrabbxyyyypqqqqAzz
  991. aaabcxyzpqrrrabbxyyyypqqqqqAzz
  992. 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz
  993. aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  994. 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  995. aaaabcxyzpqrrrabbxyyyypqAzz
  996. 0: aaaabcxyzpqrrrabbxyyyypqAzz
  997. abxyzzpqrrrabbxyyyypqAzz
  998. 0: abxyzzpqrrrabbxyyyypqAzz
  999. aabxyzzzpqrrrabbxyyyypqAzz
  1000. 0: aabxyzzzpqrrrabbxyyyypqAzz
  1001. aaabxyzzzzpqrrrabbxyyyypqAzz
  1002. 0: aaabxyzzzzpqrrrabbxyyyypqAzz
  1003. aaaabxyzzzzpqrrrabbxyyyypqAzz
  1004. 0: aaaabxyzzzzpqrrrabbxyyyypqAzz
  1005. abcxyzzpqrrrabbxyyyypqAzz
  1006. 0: abcxyzzpqrrrabbxyyyypqAzz
  1007. aabcxyzzzpqrrrabbxyyyypqAzz
  1008. 0: aabcxyzzzpqrrrabbxyyyypqAzz
  1009. aaabcxyzzzzpqrrrabbxyyyypqAzz
  1010. 0: aaabcxyzzzzpqrrrabbxyyyypqAzz
  1011. aaaabcxyzzzzpqrrrabbxyyyypqAzz
  1012. 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz
  1013. aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  1014. 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  1015. aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  1016. 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  1017. aaabcxyzpqrrrabbxyyyypABzz
  1018. 0: aaabcxyzpqrrrabbxyyyypABzz
  1019. aaabcxyzpqrrrabbxyyyypABBzz
  1020. 0: aaabcxyzpqrrrabbxyyyypABBzz
  1021. >>>aaabxyzpqrrrabbxyyyypqAzz
  1022. 0: aaabxyzpqrrrabbxyyyypqAzz
  1023. >aaaabxyzpqrrrabbxyyyypqAzz
  1024. 0: aaaabxyzpqrrrabbxyyyypqAzz
  1025. >>>>abcxyzpqrrrabbxyyyypqAzz
  1026. 0: abcxyzpqrrrabbxyyyypqAzz
  1027. *** Failers
  1028. No match
  1029. abxyzpqrrabbxyyyypqAzz
  1030. No match
  1031. abxyzpqrrrrabbxyyyypqAzz
  1032. No match
  1033. abxyzpqrrrabxyyyypqAzz
  1034. No match
  1035. aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
  1036. No match
  1037. aaaabcxyzzzzpqrrrabbbxyyypqAzz
  1038. No match
  1039. aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
  1040. No match
  1041. /^(abc){1,2}zz/
  1042. abczz
  1043. 0: abczz
  1044. abcabczz
  1045. 0: abcabczz
  1046. *** Failers
  1047. No match
  1048. zz
  1049. No match
  1050. abcabcabczz
  1051. No match
  1052. >>abczz
  1053. No match
  1054. /^(b+?|a){1,2}?c/
  1055. bc
  1056. 0: bc
  1057. bbc
  1058. 0: bbc
  1059. bbbc
  1060. 0: bbbc
  1061. bac
  1062. 0: bac
  1063. bbac
  1064. 0: bbac
  1065. aac
  1066. 0: aac
  1067. abbbbbbbbbbbc
  1068. 0: abbbbbbbbbbbc
  1069. bbbbbbbbbbbac
  1070. 0: bbbbbbbbbbbac
  1071. *** Failers
  1072. No match
  1073. aaac
  1074. No match
  1075. abbbbbbbbbbbac
  1076. No match
  1077. /^(b+|a){1,2}c/
  1078. bc
  1079. 0: bc
  1080. bbc
  1081. 0: bbc
  1082. bbbc
  1083. 0: bbbc
  1084. bac
  1085. 0: bac
  1086. bbac
  1087. 0: bbac
  1088. aac
  1089. 0: aac
  1090. abbbbbbbbbbbc
  1091. 0: abbbbbbbbbbbc
  1092. bbbbbbbbbbbac
  1093. 0: bbbbbbbbbbbac
  1094. *** Failers
  1095. No match
  1096. aaac
  1097. No match
  1098. abbbbbbbbbbbac
  1099. No match
  1100. /^(b+|a){1,2}?bc/
  1101. bbc
  1102. 0: bbc
  1103. /^(b*|ba){1,2}?bc/
  1104. babc
  1105. 0: babc
  1106. bbabc
  1107. 0: bbabc
  1108. bababc
  1109. 0: bababc
  1110. *** Failers
  1111. No match
  1112. bababbc
  1113. No match
  1114. babababc
  1115. No match
  1116. /^(ba|b*){1,2}?bc/
  1117. babc
  1118. 0: babc
  1119. bbabc
  1120. 0: bbabc
  1121. bababc
  1122. 0: bababc
  1123. *** Failers
  1124. No match
  1125. bababbc
  1126. No match
  1127. babababc
  1128. No match
  1129. /^\ca\cA\c[\c{\c:/
  1130. \x01\x01\e;z
  1131. 0: \x01\x01\x1b;z
  1132. /^[ab\]cde]/
  1133. athing
  1134. 0: a
  1135. bthing
  1136. 0: b
  1137. ]thing
  1138. 0: ]
  1139. cthing
  1140. 0: c
  1141. dthing
  1142. 0: d
  1143. ething
  1144. 0: e
  1145. *** Failers
  1146. No match
  1147. fthing
  1148. No match
  1149. [thing
  1150. No match
  1151. \\thing
  1152. No match
  1153. /^[]cde]/
  1154. ]thing
  1155. 0: ]
  1156. cthing
  1157. 0: c
  1158. dthing
  1159. 0: d
  1160. ething
  1161. 0: e
  1162. *** Failers
  1163. No match
  1164. athing
  1165. No match
  1166. fthing
  1167. No match
  1168. /^[^ab\]cde]/
  1169. fthing
  1170. 0: f
  1171. [thing
  1172. 0: [
  1173. \\thing
  1174. 0: \
  1175. *** Failers
  1176. 0: *
  1177. athing
  1178. No match
  1179. bthing
  1180. No match
  1181. ]thing
  1182. No match
  1183. cthing
  1184. No match
  1185. dthing
  1186. No match
  1187. ething
  1188. No match
  1189. /^[^]cde]/
  1190. athing
  1191. 0: a
  1192. fthing
  1193. 0: f
  1194. *** Failers
  1195. 0: *
  1196. ]thing
  1197. No match
  1198. cthing
  1199. No match
  1200. dthing
  1201. No match
  1202. ething
  1203. No match
  1204. /^\Б/
  1205. Б
  1206. 0: \x81
  1207. /^/
  1208. 0: \xff
  1209. /^[0-9]+$/
  1210. 0
  1211. 0: 0
  1212. 1
  1213. 0: 1
  1214. 2
  1215. 0: 2
  1216. 3
  1217. 0: 3
  1218. 4
  1219. 0: 4
  1220. 5
  1221. 0: 5
  1222. 6
  1223. 0: 6
  1224. 7
  1225. 0: 7
  1226. 8
  1227. 0: 8
  1228. 9
  1229. 0: 9
  1230. 10
  1231. 0: 10
  1232. 100
  1233. 0: 100
  1234. *** Failers
  1235. No match
  1236. abc
  1237. No match
  1238. /^.*nter/
  1239. enter
  1240. 0: enter
  1241. inter
  1242. 0: inter
  1243. uponter
  1244. 0: uponter
  1245. /^xxx[0-9]+$/
  1246. xxx0
  1247. 0: xxx0
  1248. xxx1234
  1249. 0: xxx1234
  1250. *** Failers
  1251. No match
  1252. xxx
  1253. No match
  1254. /^.+[0-9][0-9][0-9]$/
  1255. x123
  1256. 0: x123
  1257. xx123
  1258. 0: xx123
  1259. 123456
  1260. 0: 123456
  1261. *** Failers
  1262. No match
  1263. 123
  1264. No match
  1265. x1234
  1266. 0: x1234
  1267. /^.+?[0-9][0-9][0-9]$/
  1268. x123
  1269. 0: x123
  1270. xx123
  1271. 0: xx123
  1272. 123456
  1273. 0: 123456
  1274. *** Failers
  1275. No match
  1276. 123
  1277. No match
  1278. x1234
  1279. 0: x1234
  1280. /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
  1281. abc!pqr=apquxz.ixr.zzz.ac.uk
  1282. 0: abc!pqr=apquxz.ixr.zzz.ac.uk
  1283. *** Failers
  1284. No match
  1285. !pqr=apquxz.ixr.zzz.ac.uk
  1286. No match
  1287. abc!=apquxz.ixr.zzz.ac.uk
  1288. No match
  1289. abc!pqr=apquxz:ixr.zzz.ac.uk
  1290. No match
  1291. abc!pqr=apquxz.ixr.zzz.ac.ukk
  1292. No match
  1293. /:/
  1294. Well, we need a colon: somewhere
  1295. 0: :
  1296. *** Fail if we don't
  1297. No match
  1298. /([\da-f:]+)$/i
  1299. 0abc
  1300. 0: 0abc
  1301. abc
  1302. 0: abc
  1303. fed
  1304. 0: fed
  1305. E
  1306. 0: E
  1307. ::
  1308. 0: ::
  1309. 5f03:12C0::932e
  1310. 0: 5f03:12C0::932e
  1311. fed def
  1312. 0: def
  1313. Any old stuff
  1314. 0: ff
  1315. *** Failers
  1316. No match
  1317. 0zzz
  1318. No match
  1319. gzzz
  1320. No match
  1321. fed\x20
  1322. No match
  1323. Any old rubbish
  1324. No match
  1325. /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
  1326. .1.2.3
  1327. 0: .1.2.3
  1328. A.12.123.0
  1329. 0: A.12.123.0
  1330. *** Failers
  1331. No match
  1332. .1.2.3333
  1333. No match
  1334. 1.2.3
  1335. No match
  1336. 1234.2.3
  1337. No match
  1338. /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  1339. 1 IN SOA non-sp1 non-sp2(
  1340. 0: 1 IN SOA non-sp1 non-sp2(
  1341. 1 IN SOA non-sp1 non-sp2 (
  1342. 0: 1 IN SOA non-sp1 non-sp2 (
  1343. *** Failers
  1344. No match
  1345. 1IN SOA non-sp1 non-sp2(
  1346. No match
  1347. /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
  1348. a.
  1349. 0: a.
  1350. Z.
  1351. 0: Z.
  1352. 2.
  1353. 0: 2.
  1354. ab-c.pq-r.
  1355. 0: ab-c.pq-r.
  1356. sxk.zzz.ac.uk.
  1357. 0: sxk.zzz.ac.uk.
  1358. x-.y-.
  1359. 0: x-.y-.
  1360. *** Failers
  1361. No match
  1362. -abc.peq.
  1363. No match
  1364. /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
  1365. *.a
  1366. 0: *.a
  1367. *.b0-a
  1368. 0: *.b0-a
  1369. *.c3-b.c
  1370. 0: *.c3-b.c
  1371. *.c-a.b-c
  1372. 0: *.c-a.b-c
  1373. *** Failers
  1374. No match
  1375. *.0
  1376. No match
  1377. *.a-
  1378. No match
  1379. *.a-b.c-
  1380. No match
  1381. *.c-a.0-c
  1382. No match
  1383. /^(?=ab(de))(abd)(e)/
  1384. abde
  1385. 0: abde
  1386. /^(?!(ab)de|x)(abd)(f)/
  1387. abdf
  1388. 0: abdf
  1389. /^(?=(ab(cd)))(ab)/
  1390. abcd
  1391. 0: ab
  1392. /^[\da-f](\.[\da-f])*$/i
  1393. a.b.c.d
  1394. 0: a.b.c.d
  1395. A.B.C.D
  1396. 0: A.B.C.D
  1397. a.b.c.1.2.3.C
  1398. 0: a.b.c.1.2.3.C
  1399. /^\".*\"\s*(;.*)?$/
  1400. \"1234\"
  1401. 0: "1234"
  1402. \"abcd\" ;
  1403. 0: "abcd" ;
  1404. \"\" ; rhubarb
  1405. 0: "" ; rhubarb
  1406. *** Failers
  1407. No match
  1408. \"1234\" : things
  1409. No match
  1410. /^$/
  1411. \
  1412. 0:
  1413. *** Failers
  1414. No match
  1415. / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
  1416. ab c
  1417. 0: ab c
  1418. *** Failers
  1419. No match
  1420. abc
  1421. No match
  1422. ab cde
  1423. No match
  1424. /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
  1425. ab c
  1426. 0: ab c
  1427. *** Failers
  1428. No match
  1429. abc
  1430. No match
  1431. ab cde
  1432. No match
  1433. /^ a\ b[c ]d $/x
  1434. a bcd
  1435. 0: a bcd
  1436. a b d
  1437. 0: a b d
  1438. *** Failers
  1439. No match
  1440. abcd
  1441. No match
  1442. ab d
  1443. No match
  1444. /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
  1445. abcdefhijklm
  1446. 0: abcdefhijklm
  1447. /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
  1448. abcdefhijklm
  1449. 0: abcdefhijklm
  1450. /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
  1451. a+ Z0+\x08\n\x1d\x12
  1452. 0: a+ Z0+\x08\x0a\x1d\x12
  1453. /^[.^$|()*+?{,}]+/
  1454. .^\$(*+)|{?,?}
  1455. 0: .^$(*+)|{?,?}
  1456. 1: .^$(*+)|{?,?
  1457. 2: .^$(*+)|{?,
  1458. 3: .^$(*+)|{?
  1459. 4: .^$(*+)|{
  1460. 5: .^$(*+)|
  1461. 6: .^$(*+)
  1462. 7: .^$(*+
  1463. 8: .^$(*
  1464. 9: .^$(
  1465. 10: .^$
  1466. 11: .^
  1467. 12: .
  1468. /^a*\w/
  1469. z
  1470. 0: z
  1471. az
  1472. 0: az
  1473. 1: a
  1474. aaaz
  1475. 0: aaaz
  1476. 1: aaa
  1477. 2: aa
  1478. 3: a
  1479. a
  1480. 0: a
  1481. aa
  1482. 0: aa
  1483. 1: a
  1484. aaaa
  1485. 0: aaaa
  1486. 1: aaa
  1487. 2: aa
  1488. 3: a
  1489. a+
  1490. 0: a
  1491. aa+
  1492. 0: aa
  1493. 1: a
  1494. /^a*?\w/
  1495. z
  1496. 0: z
  1497. az
  1498. 0: az
  1499. 1: a
  1500. aaaz
  1501. 0: aaaz
  1502. 1: aaa
  1503. 2: aa
  1504. 3: a
  1505. a
  1506. 0: a
  1507. aa
  1508. 0: aa
  1509. 1: a
  1510. aaaa
  1511. 0: aaaa
  1512. 1: aaa
  1513. 2: aa
  1514. 3: a
  1515. a+
  1516. 0: a
  1517. aa+
  1518. 0: aa
  1519. 1: a
  1520. /^a+\w/
  1521. az
  1522. 0: az
  1523. aaaz
  1524. 0: aaaz
  1525. 1: aaa
  1526. 2: aa
  1527. aa
  1528. 0: aa
  1529. aaaa
  1530. 0: aaaa
  1531. 1: aaa
  1532. 2: aa
  1533. aa+
  1534. 0: aa
  1535. /^a+?\w/
  1536. az
  1537. 0: az
  1538. aaaz
  1539. 0: aaaz
  1540. 1: aaa
  1541. 2: aa
  1542. aa
  1543. 0: aa
  1544. aaaa
  1545. 0: aaaa
  1546. 1: aaa
  1547. 2: aa
  1548. aa+
  1549. 0: aa
  1550. /^\d{8}\w{2,}/
  1551. 1234567890
  1552. 0: 1234567890
  1553. 12345678ab
  1554. 0: 12345678ab
  1555. 12345678__
  1556. 0: 12345678__
  1557. *** Failers
  1558. No match
  1559. 1234567
  1560. No match
  1561. /^[aeiou\d]{4,5}$/
  1562. uoie
  1563. 0: uoie
  1564. 1234
  1565. 0: 1234
  1566. 12345
  1567. 0: 12345
  1568. aaaaa
  1569. 0: aaaaa
  1570. *** Failers
  1571. No match
  1572. 123456
  1573. No match
  1574. /^[aeiou\d]{4,5}?/
  1575. uoie
  1576. 0: uoie
  1577. 1234
  1578. 0: 1234
  1579. 12345
  1580. 0: 12345
  1581. 1: 1234
  1582. aaaaa
  1583. 0: aaaaa
  1584. 1: aaaa
  1585. 123456
  1586. 0: 12345
  1587. 1: 1234
  1588. /^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]/
  1589. From abcd Mon Sep 01 12:33:02 1997
  1590. 0: From abcd Mon Sep 01 12:33
  1591. /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
  1592. From abcd Mon Sep 01 12:33:02 1997
  1593. 0: From abcd Mon Sep 01 12:33
  1594. From abcd Mon Sep 1 12:33:02 1997
  1595. 0: From abcd Mon Sep 1 12:33
  1596. *** Failers
  1597. No match
  1598. From abcd Sep 01 12:33:02 1997
  1599. No match
  1600. /^12.34/s
  1601. 12\n34
  1602. 0: 12\x0a34
  1603. 12\r34
  1604. 0: 12\x0d34
  1605. /\w+(?=\t)/
  1606. the quick brown\t fox
  1607. 0: brown
  1608. /foo(?!bar)(.*)/
  1609. foobar is foolish see?
  1610. 0: foolish see?
  1611. 1: foolish see
  1612. 2: foolish se
  1613. 3: foolish s
  1614. 4: foolish
  1615. 5: foolish
  1616. 6: foolis
  1617. 7: fooli
  1618. 8: fool
  1619. 9: foo
  1620. /(?:(?!foo)...|^.{0,2})bar(.*)/
  1621. foobar crowbar etc
  1622. 0: rowbar etc
  1623. 1: rowbar et
  1624. 2: rowbar e
  1625. 3: rowbar
  1626. 4: rowbar
  1627. barrel
  1628. 0: barrel
  1629. 1: barre
  1630. 2: barr
  1631. 3: bar
  1632. 2barrel
  1633. 0: 2barrel
  1634. 1: 2barre
  1635. 2: 2barr
  1636. 3: 2bar
  1637. A barrel
  1638. 0: A barrel
  1639. 1: A barre
  1640. 2: A barr
  1641. 3: A bar
  1642. /^(\D*)(?=\d)(?!123)/
  1643. abc456
  1644. 0: abc
  1645. *** Failers
  1646. No match
  1647. abc123
  1648. No match
  1649. /^1234(?# test newlines
  1650. inside)/
  1651. 1234
  1652. 0: 1234
  1653. /^1234 #comment in extended re
  1654. /x
  1655. 1234
  1656. 0: 1234
  1657. /#rhubarb
  1658. abcd/x
  1659. abcd
  1660. 0: abcd
  1661. /^abcd#rhubarb/x
  1662. abcd
  1663. 0: abcd
  1664. /(?!^)abc/
  1665. the abc
  1666. 0: abc
  1667. *** Failers
  1668. No match
  1669. abc
  1670. No match
  1671. /(?=^)abc/
  1672. abc
  1673. 0: abc
  1674. *** Failers
  1675. No match
  1676. the abc
  1677. No match
  1678. /^[ab]{1,3}(ab*|b)/
  1679. aabbbbb
  1680. 0: aabbbbb
  1681. 1: aabbbb
  1682. 2: aabbb
  1683. 3: aabb
  1684. 4: aab
  1685. 5: aa
  1686. /^[ab]{1,3}?(ab*|b)/
  1687. aabbbbb
  1688. 0: aabbbbb
  1689. 1: aabbbb
  1690. 2: aabbb
  1691. 3: aabb
  1692. 4: aab
  1693. 5: aa
  1694. /^[ab]{1,3}?(ab*?|b)/
  1695. aabbbbb
  1696. 0: aabbbbb
  1697. 1: aabbbb
  1698. 2: aabbb
  1699. 3: aabb
  1700. 4: aab
  1701. 5: aa
  1702. /^[ab]{1,3}(ab*?|b)/
  1703. aabbbbb
  1704. 0: aabbbbb
  1705. 1: aabbbb
  1706. 2: aabbb
  1707. 3: aabb
  1708. 4: aab
  1709. 5: aa
  1710. / (?: [\040\t] | \(
  1711. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1712. \) )* # optional leading comment
  1713. (?: (?:
  1714. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1715. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1716. |
  1717. " (?: # opening quote...
  1718. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1719. | # or
  1720. \\ [^\x80-\xff] # Escaped something (something != CR)
  1721. )* " # closing quote
  1722. ) # initial word
  1723. (?: (?: [\040\t] | \(
  1724. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1725. \) )* \. (?: [\040\t] | \(
  1726. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1727. \) )* (?:
  1728. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1729. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1730. |
  1731. " (?: # opening quote...
  1732. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1733. | # or
  1734. \\ [^\x80-\xff] # Escaped something (something != CR)
  1735. )* " # closing quote
  1736. ) )* # further okay, if led by a period
  1737. (?: [\040\t] | \(
  1738. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1739. \) )* @ (?: [\040\t] | \(
  1740. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1741. \) )* (?:
  1742. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1743. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1744. | \[ # [
  1745. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1746. \] # ]
  1747. ) # initial subdomain
  1748. (?: #
  1749. (?: [\040\t] | \(
  1750. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1751. \) )* \. # if led by a period...
  1752. (?: [\040\t] | \(
  1753. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1754. \) )* (?:
  1755. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1756. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1757. | \[ # [
  1758. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1759. \] # ]
  1760. ) # ...further okay
  1761. )*
  1762. # address
  1763. | # or
  1764. (?:
  1765. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1766. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1767. |
  1768. " (?: # opening quote...
  1769. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1770. | # or
  1771. \\ [^\x80-\xff] # Escaped something (something != CR)
  1772. )* " # closing quote
  1773. ) # one word, optionally followed by....
  1774. (?:
  1775. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  1776. \(
  1777. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1778. \) | # comments, or...
  1779. " (?: # opening quote...
  1780. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1781. | # or
  1782. \\ [^\x80-\xff] # Escaped something (something != CR)
  1783. )* " # closing quote
  1784. # quoted strings
  1785. )*
  1786. < (?: [\040\t] | \(
  1787. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1788. \) )* # leading <
  1789. (?: @ (?: [\040\t] | \(
  1790. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1791. \) )* (?:
  1792. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1793. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1794. | \[ # [
  1795. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1796. \] # ]
  1797. ) # initial subdomain
  1798. (?: #
  1799. (?: [\040\t] | \(
  1800. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1801. \) )* \. # if led by a period...
  1802. (?: [\040\t] | \(
  1803. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1804. \) )* (?:
  1805. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1806. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1807. | \[ # [
  1808. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1809. \] # ]
  1810. ) # ...further okay
  1811. )*
  1812. (?: (?: [\040\t] | \(
  1813. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1814. \) )* , (?: [\040\t] | \(
  1815. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1816. \) )* @ (?: [\040\t] | \(
  1817. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1818. \) )* (?:
  1819. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1820. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1821. | \[ # [
  1822. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1823. \] # ]
  1824. ) # initial subdomain
  1825. (?: #
  1826. (?: [\040\t] | \(
  1827. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1828. \) )* \. # if led by a period...
  1829. (?: [\040\t] | \(
  1830. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1831. \) )* (?:
  1832. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1833. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1834. | \[ # [
  1835. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1836. \] # ]
  1837. ) # ...further okay
  1838. )*
  1839. )* # further okay, if led by comma
  1840. : # closing colon
  1841. (?: [\040\t] | \(
  1842. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1843. \) )* )? # optional route
  1844. (?:
  1845. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1846. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1847. |
  1848. " (?: # opening quote...
  1849. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1850. | # or
  1851. \\ [^\x80-\xff] # Escaped something (something != CR)
  1852. )* " # closing quote
  1853. ) # initial word
  1854. (?: (?: [\040\t] | \(
  1855. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1856. \) )* \. (?: [\040\t] | \(
  1857. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1858. \) )* (?:
  1859. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1860. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1861. |
  1862. " (?: # opening quote...
  1863. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1864. | # or
  1865. \\ [^\x80-\xff] # Escaped something (something != CR)
  1866. )* " # closing quote
  1867. ) )* # further okay, if led by a period
  1868. (?: [\040\t] | \(
  1869. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1870. \) )* @ (?: [\040\t] | \(
  1871. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1872. \) )* (?:
  1873. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1874. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1875. | \[ # [
  1876. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1877. \] # ]
  1878. ) # initial subdomain
  1879. (?: #
  1880. (?: [\040\t] | \(
  1881. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1882. \) )* \. # if led by a period...
  1883. (?: [\040\t] | \(
  1884. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1885. \) )* (?:
  1886. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1887. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1888. | \[ # [
  1889. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1890. \] # ]
  1891. ) # ...further okay
  1892. )*
  1893. # address spec
  1894. (?: [\040\t] | \(
  1895. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1896. \) )* > # trailing >
  1897. # name and address
  1898. ) (?: [\040\t] | \(
  1899. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1900. \) )* # optional trailing comment
  1901. /x
  1902. Alan Other <user\@dom.ain>
  1903. 0: Alan Other <user@dom.ain>
  1904. <user\@dom.ain>
  1905. 0: user@dom.ain
  1906. 1: user@dom
  1907. user\@dom.ain
  1908. 0: user@dom.ain
  1909. 1: user@dom
  1910. \"A. Other\" <user.1234\@dom.ain> (a comment)
  1911. 0: "A. Other" <user.1234@dom.ain> (a comment)
  1912. 1: "A. Other" <user.1234@dom.ain>
  1913. 2: "A. Other" <user.1234@dom.ain>
  1914. A. Other <user.1234\@dom.ain> (a comment)
  1915. 0: Other <user.1234@dom.ain> (a comment)
  1916. 1: Other <user.1234@dom.ain>
  1917. 2: Other <user.1234@dom.ain>
  1918. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  1919. 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
  1920. 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re
  1921. A missing angle <user\@some.where
  1922. 0: user@some.where
  1923. 1: user@some
  1924. *** Failers
  1925. No match
  1926. The quick brown fox
  1927. No match
  1928. /[\040\t]* # Nab whitespace.
  1929. (?:
  1930. \( # (
  1931. [^\\\x80-\xff\n\015()] * # normal*
  1932. (?: # (
  1933. (?: \\ [^\x80-\xff] |
  1934. \( # (
  1935. [^\\\x80-\xff\n\015()] * # normal*
  1936. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1937. \) # )
  1938. ) # special
  1939. [^\\\x80-\xff\n\015()] * # normal*
  1940. )* # )*
  1941. \) # )
  1942. [\040\t]* )* # If comment found, allow more spaces.
  1943. # optional leading comment
  1944. (?:
  1945. (?:
  1946. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1947. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1948. # Atom
  1949. | # or
  1950. " # "
  1951. [^\\\x80-\xff\n\015"] * # normal
  1952. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1953. " # "
  1954. # Quoted string
  1955. )
  1956. [\040\t]* # Nab whitespace.
  1957. (?:
  1958. \( # (
  1959. [^\\\x80-\xff\n\015()] * # normal*
  1960. (?: # (
  1961. (?: \\ [^\x80-\xff] |
  1962. \( # (
  1963. [^\\\x80-\xff\n\015()] * # normal*
  1964. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1965. \) # )
  1966. ) # special
  1967. [^\\\x80-\xff\n\015()] * # normal*
  1968. )* # )*
  1969. \) # )
  1970. [\040\t]* )* # If comment found, allow more spaces.
  1971. (?:
  1972. \.
  1973. [\040\t]* # Nab whitespace.
  1974. (?:
  1975. \( # (
  1976. [^\\\x80-\xff\n\015()] * # normal*
  1977. (?: # (
  1978. (?: \\ [^\x80-\xff] |
  1979. \( # (
  1980. [^\\\x80-\xff\n\015()] * # normal*
  1981. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1982. \) # )
  1983. ) # special
  1984. [^\\\x80-\xff\n\015()] * # normal*
  1985. )* # )*
  1986. \) # )
  1987. [\040\t]* )* # If comment found, allow more spaces.
  1988. (?:
  1989. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1990. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1991. # Atom
  1992. | # or
  1993. " # "
  1994. [^\\\x80-\xff\n\015"] * # normal
  1995. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1996. " # "
  1997. # Quoted string
  1998. )
  1999. [\040\t]* # Nab whitespace.
  2000. (?:
  2001. \( # (
  2002. [^\\\x80-\xff\n\015()] * # normal*
  2003. (?: # (
  2004. (?: \\ [^\x80-\xff] |
  2005. \( # (
  2006. [^\\\x80-\xff\n\015()] * # normal*
  2007. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2008. \) # )
  2009. ) # special
  2010. [^\\\x80-\xff\n\015()] * # normal*
  2011. )* # )*
  2012. \) # )
  2013. [\040\t]* )* # If comment found, allow more spaces.
  2014. # additional words
  2015. )*
  2016. @
  2017. [\040\t]* # Nab whitespace.
  2018. (?:
  2019. \( # (
  2020. [^\\\x80-\xff\n\015()] * # normal*
  2021. (?: # (
  2022. (?: \\ [^\x80-\xff] |
  2023. \( # (
  2024. [^\\\x80-\xff\n\015()] * # normal*
  2025. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2026. \) # )
  2027. ) # special
  2028. [^\\\x80-\xff\n\015()] * # normal*
  2029. )* # )*
  2030. \) # )
  2031. [\040\t]* )* # If comment found, allow more spaces.
  2032. (?:
  2033. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2034. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2035. |
  2036. \[ # [
  2037. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2038. \] # ]
  2039. )
  2040. [\040\t]* # Nab whitespace.
  2041. (?:
  2042. \( # (
  2043. [^\\\x80-\xff\n\015()] * # normal*
  2044. (?: # (
  2045. (?: \\ [^\x80-\xff] |
  2046. \( # (
  2047. [^\\\x80-\xff\n\015()] * # normal*
  2048. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2049. \) # )
  2050. ) # special
  2051. [^\\\x80-\xff\n\015()] * # normal*
  2052. )* # )*
  2053. \) # )
  2054. [\040\t]* )* # If comment found, allow more spaces.
  2055. # optional trailing comments
  2056. (?:
  2057. \.
  2058. [\040\t]* # Nab whitespace.
  2059. (?:
  2060. \( # (
  2061. [^\\\x80-\xff\n\015()] * # normal*
  2062. (?: # (
  2063. (?: \\ [^\x80-\xff] |
  2064. \( # (
  2065. [^\\\x80-\xff\n\015()] * # normal*
  2066. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2067. \) # )
  2068. ) # special
  2069. [^\\\x80-\xff\n\015()] * # normal*
  2070. )* # )*
  2071. \) # )
  2072. [\040\t]* )* # If comment found, allow more spaces.
  2073. (?:
  2074. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2075. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2076. |
  2077. \[ # [
  2078. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2079. \] # ]
  2080. )
  2081. [\040\t]* # Nab whitespace.
  2082. (?:
  2083. \( # (
  2084. [^\\\x80-\xff\n\015()] * # normal*
  2085. (?: # (
  2086. (?: \\ [^\x80-\xff] |
  2087. \( # (
  2088. [^\\\x80-\xff\n\015()] * # normal*
  2089. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2090. \) # )
  2091. ) # special
  2092. [^\\\x80-\xff\n\015()] * # normal*
  2093. )* # )*
  2094. \) # )
  2095. [\040\t]* )* # If comment found, allow more spaces.
  2096. # optional trailing comments
  2097. )*
  2098. # address
  2099. | # or
  2100. (?:
  2101. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2102. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2103. # Atom
  2104. | # or
  2105. " # "
  2106. [^\\\x80-\xff\n\015"] * # normal
  2107. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  2108. " # "
  2109. # Quoted string
  2110. )
  2111. # leading word
  2112. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
  2113. (?:
  2114. (?:
  2115. \( # (
  2116. [^\\\x80-\xff\n\015()] * # normal*
  2117. (?: # (
  2118. (?: \\ [^\x80-\xff] |
  2119. \( # (
  2120. [^\\\x80-\xff\n\015()] * # normal*
  2121. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2122. \) # )
  2123. ) # special
  2124. [^\\\x80-\xff\n\015()] * # normal*
  2125. )* # )*
  2126. \) # )
  2127. |
  2128. " # "
  2129. [^\\\x80-\xff\n\015"] * # normal
  2130. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  2131. " # "
  2132. ) # "special" comment or quoted string
  2133. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
  2134. )*
  2135. <
  2136. [\040\t]* # Nab whitespace.
  2137. (?:
  2138. \( # (
  2139. [^\\\x80-\xff\n\015()] * # normal*
  2140. (?: # (
  2141. (?: \\ [^\x80-\xff] |
  2142. \( # (
  2143. [^\\\x80-\xff\n\015()] * # normal*
  2144. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2145. \) # )
  2146. ) # special
  2147. [^\\\x80-\xff\n\015()] * # normal*
  2148. )* # )*
  2149. \) # )
  2150. [\040\t]* )* # If comment found, allow more spaces.
  2151. # <
  2152. (?:
  2153. @
  2154. [\040\t]* # Nab whitespace.
  2155. (?:
  2156. \( # (
  2157. [^\\\x80-\xff\n\015()] * # normal*
  2158. (?: # (
  2159. (?: \\ [^\x80-\xff] |
  2160. \( # (
  2161. [^\\\x80-\xff\n\015()] * # normal*
  2162. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2163. \) # )
  2164. ) # special
  2165. [^\\\x80-\xff\n\015()] * # normal*
  2166. )* # )*
  2167. \) # )
  2168. [\040\t]* )* # If comment found, allow more spaces.
  2169. (?:
  2170. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2171. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2172. |
  2173. \[ # [
  2174. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2175. \] # ]
  2176. )
  2177. [\040\t]* # Nab whitespace.
  2178. (?:
  2179. \( # (
  2180. [^\\\x80-\xff\n\015()] * # normal*
  2181. (?: # (
  2182. (?: \\ [^\x80-\xff] |
  2183. \( # (
  2184. [^\\\x80-\xff\n\015()] * # normal*
  2185. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2186. \) # )
  2187. ) # special
  2188. [^\\\x80-\xff\n\015()] * # normal*
  2189. )* # )*
  2190. \) # )
  2191. [\040\t]* )* # If comment found, allow more spaces.
  2192. # optional trailing comments
  2193. (?:
  2194. \.
  2195. [\040\t]* # Nab whitespace.
  2196. (?:
  2197. \( # (
  2198. [^\\\x80-\xff\n\015()] * # normal*
  2199. (?: # (
  2200. (?: \\ [^\x80-\xff] |
  2201. \( # (
  2202. [^\\\x80-\xff\n\015()] * # normal*
  2203. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2204. \) # )
  2205. ) # special
  2206. [^\\\x80-\xff\n\015()] * # normal*
  2207. )* # )*
  2208. \) # )
  2209. [\040\t]* )* # If comment found, allow more spaces.
  2210. (?:
  2211. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2212. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2213. |
  2214. \[ # [
  2215. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2216. \] # ]
  2217. )
  2218. [\040\t]* # Nab whitespace.
  2219. (?:
  2220. \( # (
  2221. [^\\\x80-\xff\n\015()] * # normal*
  2222. (?: # (
  2223. (?: \\ [^\x80-\xff] |
  2224. \( # (
  2225. [^\\\x80-\xff\n\015()] * # normal*
  2226. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2227. \) # )
  2228. ) # special
  2229. [^\\\x80-\xff\n\015()] * # normal*
  2230. )* # )*
  2231. \) # )
  2232. [\040\t]* )* # If comment found, allow more spaces.
  2233. # optional trailing comments
  2234. )*
  2235. (?: ,
  2236. [\040\t]* # Nab whitespace.
  2237. (?:
  2238. \( # (
  2239. [^\\\x80-\xff\n\015()] * # normal*
  2240. (?: # (
  2241. (?: \\ [^\x80-\xff] |
  2242. \( # (
  2243. [^\\\x80-\xff\n\015()] * # normal*
  2244. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2245. \) # )
  2246. ) # special
  2247. [^\\\x80-\xff\n\015()] * # normal*
  2248. )* # )*
  2249. \) # )
  2250. [\040\t]* )* # If comment found, allow more spaces.
  2251. @
  2252. [\040\t]* # Nab whitespace.
  2253. (?:
  2254. \( # (
  2255. [^\\\x80-\xff\n\015()] * # normal*
  2256. (?: # (
  2257. (?: \\ [^\x80-\xff] |
  2258. \( # (
  2259. [^\\\x80-\xff\n\015()] * # normal*
  2260. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2261. \) # )
  2262. ) # special
  2263. [^\\\x80-\xff\n\015()] * # normal*
  2264. )* # )*
  2265. \) # )
  2266. [\040\t]* )* # If comment found, allow more spaces.
  2267. (?:
  2268. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2269. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2270. |
  2271. \[ # [
  2272. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2273. \] # ]
  2274. )
  2275. [\040\t]* # Nab whitespace.
  2276. (?:
  2277. \( # (
  2278. [^\\\x80-\xff\n\015()] * # normal*
  2279. (?: # (
  2280. (?: \\ [^\x80-\xff] |
  2281. \( # (
  2282. [^\\\x80-\xff\n\015()] * # normal*
  2283. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2284. \) # )
  2285. ) # special
  2286. [^\\\x80-\xff\n\015()] * # normal*
  2287. )* # )*
  2288. \) # )
  2289. [\040\t