1 ; Copyright 2004 Eric Niebler.
3 ; Distributed under the Boost Software License, Version 1.0.
4 ; (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
130 pat=^([-+]?[0-9]+(\.[0-9]*)?)([CF])$
140 pat=(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?
151 pat=(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?
161 str=-1234.56789e-123123123
162 pat=(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?
164 br0=-1234.56789e-123123123
173 pat=^(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?$
178 str=-1234.56789e-12312e123
179 pat=^(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?$
275 ; These results seem odd to me, but
276 ; it comforms with perl
305 ; These results seem odd to me, but
306 ; it comforms with perl
328 pat=((?i)FOO)(.*?)(?i:\1)
335 ; perl allows this, and it is pretty sick.
336 ; But anything perl can do, I can do, too.[end]
353 str=Here is a URL: http://www.cnn.com. OK?
354 pat=(https?:/|www\.)[\w\./,?@#%!_=~&-]+\w
356 br0=http://www.cnn.com
472 str=Her number is 804-867-5309.
473 pat=(?:\d{3}-){2}\d{4}
485 ; backtrack a group[end]
495 ; nested, matched parens [end]
498 str=this is sublist(now(is(the(time),for(all),good(men))to(come)))ok?
499 pat=\bsublist\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)\)[^()]*)*)\)[^()]*)*)\)[^()]*)*)\)[^()]*)*)\)
501 br0=sublist(now(is(the(time),for(all),good(men))to(come)))
504 ; nested, matched parens [end]
507 str=this is sublist(now(is(the(time),for(all),good(men))to(come))ok?
508 pat=\bsublist\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)(?>(?:\((?>[^()]*)\)[^()]*)*)\)[^()]*)*)\)[^()]*)*)\)[^()]*)*)\)
520 str=Now <foo>is</foo> the time for all <BOLD>good</bald> men</bold> to come to the aid of their country.
521 pat=<(.*?)>(.*?)</(\1)>
524 res=Now {foo}is{/foo} the time for all {BOLD}good</bald> men{/bold} to come to the aid of their country.
529 br4=<BOLD>good</bald> men</bold>
536 str=Now <foo>is</foo> the time for all <BOLD>good</bald> men</bold> to come to the aid of their country.
537 pat=<(.*?)>(.*?)</(\1)>
540 res=Now {foo}is{/foo} the time for all {BOLD}good</bald> men{/bold} to come to the aid of their country.
545 br4=<BOLD>good</bald> men</bold>
552 str=Now is the time for all good men to come to the aid of their country.
556 res=NOw is the time fOr all gOOd men tO cOme tO the aid Of their cOuntry.
593 res=Foo(FooBar)foobar
602 res=Foo(FooBar)foobar
611 res=Foo(FooBar)foo(FooBarfoobar)
621 res=Foo(FooBar)foo(FooBarfoobar)
631 res=Foo(foobarBar)foo(bar)
641 res=Foo(foobarBar)foo(bar)
698 str=This (has) parens
699 pat=This (\Q(has)\E) (parens)
701 br0=This (has) parens
707 str=This (has) parens
708 pat=This \Q(has) parens\E
710 br0=This (has) parens
714 str=This (has) parens
715 pat=This \Q(has) parens
717 br0=This (has) parens
721 ;str=THAT IS UPPERCASE is
725 ;res=THAT UL$&ISn't UPPERCASE UL$&isn't
787 pat=(\(()|\[()).*?(\)\2|\]\3)
798 pat=(\(()|\[()).*?(\)\2|\]\3)
809 pat=(\(()|\[()).*?(\)\2|\]\3)
858 pat=[[:alpha:][:digit:]]+
873 pat=(?<=(abc\d{3}))foo
922 pat=^(?:\(()|())\w+(?:\)\1|\2)$
931 pat=^(?:\(()|())\w+(?:\)\1|\2)$
940 pat=^(?:\(()|())\w+(?:\)\1|\2)$
946 pat=^(?:\(()|())\w+(?:\)\1|\2)$
959 pat=[[:^alpha:][:alpha:]]+
980 pat=[^[:^alnum:][:^digit:]]+
1001 ; test for possible infinite recursion
1019 str=nothere(HE(hehe(a(b(c)))nothere
1020 pat=\(((?>[^()]+)|(?R))*\)
1027 str=1(abcd)(x(y)z)pqr
1028 pat=\(((?>[^()]+)|(?R))*\)
1038 pat=\((?:(?>[^()]+)|(?R))?\)
1044 str=12(abcde(fsh)xyz(foo(bar))lmno)89
1045 pat=\((?:(?>[^()]+)|(?R))?\)
1052 pat=\((((?>[^()]+)|(?R))*)\)
1061 pat=\((123)?(((?>[^()]+)|(?R))*)\)
1071 pat=\((123)?(((?>[^()]+)|(?R))*)\)
1080 str=(abcd(xyz<p>qrs)123)
1081 pat=\((((?>[^()<>]+)|((?>[^()]+))|(?R))*)\)
1083 br0=(abcd(xyz<p>qrs)123)
1084 br1=abcd(xyz<p>qrs)123
1092 pat=foo(?#This is a comment[)bar
1127 pat=^ f oo [ ] b ar $
1134 pat=^ ( ? : f oo [ ] b ar ) $ # This is a comment
1141 pat=^ f oo [ ] b ar # This is a comment
1147 str=foo bar#Thisisnotacomment
1148 pat=^ f oo [ ] b ar \# This is not a comment
1150 br0=foo bar#Thisisnotacomment
1155 pat=^f o(?x) o (?-x) b ar
1343 res=<><f><><o><><o><>
1358 res=<><f><><o><><o><>
1456 ; Test for backreferences over 9
1459 pat=()()()()()()()()()()()(hello)\12
1475 ; test for named captures
1478 pat=(?P<this>he(ll)o)(?P=this)
1484 ; test for named captures
1487 pat=(?P<this>he(ll)o)(?P=this)
1489 sub=\u\g<this>, world
1496 ; test for quantified, non-capturing groups, bug report
1498 str=cabba\nabba\ndaba\n
1499 pat=^(c[^\r\n]*(?:\r?\n|\r)(?:(?!c)[^\r\n]*(?:\r?\n|\r))*)
1501 br0=cabba\nabba\ndaba\n
1502 br1=cabba\nabba\ndaba\n
1505 ; tests pilfered from Boost.Regex test_tricky_cases.cpp
1544 str=aaaaabaaaabaaaabaaaab
1547 br0=aaaaabaaaabaaaabaaaab
1551 str=aaaaabaaaabaaaabaaaab
1552 pat=a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]
1554 br0=aaaaabaaaabaaaabaaaab
1558 str=aaaaabaaaabaaaabaaaabweeknights
1559 pat=a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)
1561 br0=aaaaabaaaabaaaabaaaabweeknights
1567 str=a1234567890123456789012345678901234567890123456789012345678901234567890b
1568 pat=1234567890123456789012345678901234567890123456789012345678901234567890
1570 br0=1234567890123456789012345678901234567890123456789012345678901234567890
1575 pat=[ab][cd][ef][gh][ij][kl][mn]
1582 pat=[ab][cd][ef][gh][ij][kl][mn][op]
1589 pat=[ab][cd][ef][gh][ij][kl][mn][op][qr]
1596 pat=[ab][cd][ef][gh][ij][kl][mn][op][q]
1603 pat=(a)(b)(c)(d)(e)(f)(g)(h)
1618 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)
1634 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)
1651 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)
1677 str=_wwwnocolon _mailto:
1678 pat=_+((www)|(ftp)|(mailto)):_*
1706 pat=(wee|week)(knights|night)
1805 pat=(a|ab)(bc([de]+)f|cde)
1909 pat=Z(((((((a+)+)+)+)+)+)+)+|Y(((((((a+)+)+)+)+)+)+)+|X(((((((a+)+)+)+)+)+)+)+|W(((((((a+)+)+)+)+)+)+)+|V(((((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+)+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV(((((((a+)+)+)+)+)+)+)+|(a+)+
1915 pat=Z(((((((a+)+)+)+)+)+)+)+|Y(((((((a+)+)+)+)+)+)+)+|X(((((((a+)+)+)+)+)+)+)+|W(((((((a+)+)+)+)+)+)+)+|V(((((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+)+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV(((((((a+)+)+)+)+)+)+)+|(a+)+
1993 pat=Z(((((((a+)+)+)+)+)+)+)+|Y(((((((a+)+)+)+)+)+)+)+|X(((((((a+)+)+)+)+)+)+)+|W(((((((a+)+)+)+)+)+)+)+|V(((((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+)+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV(((((((a+)+)+)+)+)+)+)+|(a+)+
2305 str=aaaaabaaaabaaaabaaaab
2308 br0=aaaaabaaaabaaaabaaaab
2312 str=aaaaabaaaabaaaabaaaab
2313 pat=a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]
2315 br0=aaaaabaaaabaaaabaaaab
2319 str=aaaaabaaaabaaaabaaaabweeknights
2320 pat=a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)
2322 br0=aaaaabaaaabaaaabaaaabweeknights
2328 str=a1234567890123456789012345678901234567890123456789012345678901234567890b
2329 pat=1234567890123456789012345678901234567890123456789012345678901234567890
2331 br0=1234567890123456789012345678901234567890123456789012345678901234567890
2336 pat=[ab][cd][ef][gh][ij][kl][mn]
2343 pat=[ab][cd][ef][gh][ij][kl][mn][op]
2350 pat=[ab][cd][ef][gh][ij][kl][mn][op][qr]
2357 pat=[ab][cd][ef][gh][ij][kl][mn][op][q]
2364 pat=(a)(b)(c)(d)(e)(f)(g)(h)
2379 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)
2395 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)
2412 pat=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)
2438 str=_wwwnocolon _mailto:
2439 pat=_+((www)|(ftp)|(mailto)):_*
2458 pat=(wee|week)(knights|night)
2557 pat=(a|ab)(bc([de]+)f|cde)
2939 str=++i //here is a line comment\n
2942 br0=//here is a line comment
2946 str=/* here is a block comment */
2947 pat=/\*([^*]|\*+[^*/])*\*+/
2949 br0=/* here is a block comment */
2955 pat=/\*([^*]|\*+[^*/])*\*+/
2963 pat=/\*([^*]|\*+[^*/])*\*+/
2971 pat=/\*([^*]|\*+[^*/])*\*+/
2979 pat=/\*([^*]|\*+[^*/])*\*+/
2987 pat=/\*([^*]|\*+[^*/])*\*+/
2994 str=#define some_symbol
2995 pat=^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]*
2997 br0=#define some_symbol
3002 str=#define some_symbol(x) #x
3003 pat=^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]*
3005 br0=#define some_symbol(x) #x
3010 str=#define some_symbol(x) \\ \r\n foo();\\\r\n printf(#x);
3011 pat=^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]*
3013 br0=#define some_symbol(x) \\ \r\n foo();\\\r\n printf(#x);
3028 pat=((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)?
3041 pat=((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)?
3054 pat=((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)?
3067 pat=((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)?
3079 str=0xFFFFFFFFFFFFFFFFuint64
3080 pat=((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)?
3082 br0=0xFFFFFFFFFFFFFFFFuint64
3083 br1=0xFFFFFFFFFFFFFFFF
3084 br2=0xFFFFFFFFFFFFFFFF
3116 str=0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}
3117 pat=0123456789@abcdefghijklmnopqrstuvwxyz\[\\\]\^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ\{\|\}
3119 br0=0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}
3496 pat=(\.[[:alnum:]]+){2}
3633 str=xxxxxxxxyyyyyyyyab
3639 str=abcdxxxyyyxxxyyy
3647 str=___________________________________________x
3685 sub=(?1(?2(C:):A):B:)
3729 str=abc\r\ndef\r\nghi
3736 str=abc\r\ndef\r\nghi
3743 str=common HighLight and Blow this
3747 res=common <b>HighLight</b> and <b>Blow</b> this
3754 pat=(?P<f>.+):(?P<l>[0-9]+):((?P<c>[0-9]+):)?.*