Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit

Ok, so this is what we start with. The data files for the testfile
01-regex.t are copied from the Parrot repository, as is LICENSE.
The other files are specific to this project.
  • Loading branch information...
commit 1cc6bfe7677a5061a0b682906e44d02142c2afcf 0 parents
@masak authored
201 LICENSE
@@ -0,0 +1,201 @@
+ The Artistic License 2.0
+
+ Copyright (c) 2000-2006, The Perl Foundation.
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package. If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+ "Copyright Holder" means the individual(s) or organization(s)
+ named in the copyright notice for the entire Package.
+
+ "Contributor" means any party that has contributed code or other
+ material to the Package, in accordance with the Copyright Holder's
+ procedures.
+
+ "You" and "your" means any person who would like to copy,
+ distribute, or modify the Package.
+
+ "Package" means the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection and/or of
+ those files. A given Package may consist of either the Standard
+ Version, or a Modified Version.
+
+ "Distribute" means providing a copy of the Package or making it
+ accessible to anyone else, or in the case of a company or
+ organization, to others outside of your company or organization.
+
+ "Distributor Fee" means any fee that you charge for Distributing
+ this Package or providing support for this Package to another
+ party. It does not mean licensing fees.
+
+ "Standard Version" refers to the Package if it has not been
+ modified, or has been modified only in ways explicitly requested
+ by the Copyright Holder.
+
+ "Modified Version" means the Package, if it has been changed, and
+ such changes were not explicitly requested by the Copyright
+ Holder.
+
+ "Original License" means this Artistic License as Distributed with
+ the Standard Version of the Package, in its current version or as
+ it may be modified by The Perl Foundation in the future.
+
+ "Source" form means the source code, documentation source, and
+ configuration files for the Package.
+
+ "Compiled" form means the compiled bytecode, object code, binary,
+ or any other form resulting from mechanical transformation or
+ translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1) You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2) You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers. At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3) You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder. The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4) You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+ (a) make the Modified Version available to the Copyright Holder
+ of the Standard Version, under the Original License, so that the
+ Copyright Holder may include your modifications in the Standard
+ Version.
+
+ (b) ensure that installation of your Modified Version does not
+ prevent the user installing or running the Standard Version. In
+ addition, the Modified Version must bear a name that is different
+ from the name of the Standard Version.
+
+ (c) allow anyone who receives a copy of the Modified Version to
+ make the Source form of the Modified Version available to others
+ under
+
+ (i) the Original License or
+
+ (ii) a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5) You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version. Such instructions must be
+valid at the time of your distribution. If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6) You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7) You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package. Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version. In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10) Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11) If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12) This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13) This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14) Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 README
@@ -0,0 +1,40 @@
+== Glacial Grammar Engine -- like PGE, but slower
+
+Ok, so there was some guy called Patrick who implemented a thing called
+PGE, right? It was this grammar engine written in PIR, a low-level
+instruction code for Parrot, a multilingual VM specifically built for dynamic
+languages. PGE was the first thing in the known universe that could parse
+Perl 6 regexes. It was then plugged into PCT, a toolkit for building
+HLL (Higher-Level Language) compilers, and on top of that Rakudo, a Perl 6
+compiler, was built.
+
+In short, a whole lot of abstractions, and in the bottom of it all,
+driving the parser, sits PGE. Humming along, it does all the daily
+parsing we now take, more or less, for granted.
+
+Patrick was once caught saying that given the little time he had spent
+optimizing PGE, he was surprised it wasn't actually much slower.
+What he might not have guessed was that this off-hand statement could be
+read as a challenge: PGE surprisingly not slow enough? We know a number of
+ways to fix that...
+
+GGE, the Glacial Grammar Engine, is a faithful port of PGE from PIR to
+Perl 6. It tries (albeit not too hard) to be implementation-independent,
+and it also attempts (though perhaps not too convincingly) to be a
+drop-in replacement for PGE. Most importantly, besides being written in
+Perl 6 rather than PIR, it brings one new essential feature to the table:
+it's slower. Much slower. Hence the name.
+
+The "albeit not too hard" reservation to the implementation-dependence stems
+from the fact that some PIR tricks used by PGE are unavailable in Perl 6. When
+faced with a choice of (a) giving up, and (b) cheating by introducing some
+PIR-dependent workaround, the implementor of GGE will choose the latter road.
+
+The "though perhaps not too convincingly" reservation to GGE attempting to be a
+drop-in replacement for PGE stems from the fact that now that regular
+expressions _are_ in fact available in the Perl 6 language (through PGE), it
+would be a shame not to use them. Of course, it would be a fun challenge to
+restrict the writing of GGE to a mere subset of Perl 6 -- one not using any
+regexes at all, directly or indirectly -- but that is not the kind of fun aimed
+for in this case. Future teams of developers are welcome to aim for that kind
+of fun, should they wish.
2  lib/GGE.pm
@@ -0,0 +1,2 @@
+use v6;
+use GGE::Perl6Regex;
4 lib/GGE/Perl6Regex.pm
@@ -0,0 +1,4 @@
+use v6;
+
+class GGE::Perl6Regex {
+}
64 t/perl6regex/01-regex.t
@@ -0,0 +1,64 @@
+use v6;
+use Test;
+use GGE;
+
+sub dirname($path) { $path.comb(/<-[/]>+ '/'/).join() }
+
+my @test-files = <
+ quantifiers
+>;
+
+for @test-files -> $test-file {
+ my $filename = dirname($*PROGRAM_NAME) ~ 'rx_' ~ $test-file;
+ my $fh = open $filename, :r;
+ my $i = 0;
+ for $fh.lines -> $line {
+ next if $line ~~ '';
+ next if $line ~~ /^ \#/;
+ $i++;
+ $line ~~ /^ (<-[\t]>*) \t+ (<-[\t]>+) \t+ (<-[\t]>+) \t+ (.*) $/
+ or die "Unrecognized line format: $line";
+ my ($pattern, $target, $result, $description) = $0, $1, $2, $3;
+ $pattern = backslash_escape($pattern);
+ $target = backslash_escape($target);
+ my $full-description = "[$test-file:$i] $description";
+ my $match;
+ my $failed = 1; # RAKUDO: Manual CATCH workaround
+ try {
+ $match = match_perl6regex($pattern, $target);
+ $failed = 0;
+ }
+ if $failed {
+ if $result eq 'y'|'n' {
+ nok 1, $full-description;
+ }
+ else {
+ $result .= substr(1,-1); # remove /'s
+ ok defined((~$!).index($result)), $full-description;
+ }
+ }
+ elsif $result eq 'y' {
+ ok ?$match, $full-description;
+ }
+ elsif $result eq 'n' {
+ ok !$match, $full-description;
+ }
+ else {
+ $result .= substr(1,-1); # remove /'s
+ ok defined($match.dump_str.index($result)), $full-description;
+ }
+ }
+}
+
+sub match_perl6regex($pattern, $target) {
+ my $rule = GGE::Perl6Regex.new($pattern);
+ return $rule($target);
+}
+
+sub backslash_escape($string) {
+ return $string.trans(['\n', '\r', '\e', '\t', '\f'] =>
+ ["\n", "\r", "\e", "\t", "\f"])\
+ .subst(/'\\x' (\d\d)/, { chr(:16($0)) }, :g);
+}
+
+done_testing;
33 t/perl6regex/rx_backtrack
@@ -0,0 +1,33 @@
+## Backtracking control tests
+a* a bazaar y control
+# todo :pge<adverbs before backtrack(?)>
+a*:a bazaar /:a/ basic
+a*: a bazaar n basic
+^[a|b]* aba abbabbababba y control
+^[a|b]*: aba abbabbababba n outside a group
+\d+: 123abc y cut on character class shortcut
+\d+: abc n cut on character class shortcut
+[ if not | ify ] verify y control
+[ if :: not | ify ] verify n inside a group
+ if :: not | ify verify n the default all group
+# todo :pugs<feature>
+[ if : not | ify ] verify y simple backtrack still works
+# todo :pugs<feature>
+[ if :: not | ify ] | verify verify y rule continues
+[ when ever ] | whence whence y full backtrack failure
+[ when ::: ever ] | whence whence n full backtrack failure
+# todo :pugs<feature>
+ab::cd | gh::ij xyabghij y group cut at top
+ab:::cd | gh:::ij xyabghij n rule cut at top
+# todo :pugs<feature>
+[ab::cd | gh::ij] xyabghij y group cut in group
+[ab:::cd | gh:::ij] xyabghij n rule cut in group
+[ ab | abc ]: de xyzabcde n no backtrack into group
+( ab | abc ): de xyzabcde n no backtrack into subpattern
+# todo :pugs<feature>
+[ when <commit> ever ] | whence whence n full backtrack failure
+
+:ratchet a* a bazaar n ratchet modifier
+:ratchet a*! a bazaar y force backtracking !
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
63 t/perl6regex/rx_captures
@@ -0,0 +1,63 @@
+## captures
+(a.)..(..) zzzabcdefzzz y basic match
+(a.)..(..) zzzabcdefzzz /mob: <abcdef @ 3>/ basic $0
+(a.)..(..) zzzabcdefzzz /mob 0: <ab @ 3>/ basic $1
+(a.)..(..) zzzabcdefzzz /mob 1: <ef @ 7>/ basic $2
+(a(b(c))(d)) abcd y nested match
+(a(b(c))(d)) abcd /mob: <abcd @ 0>/ nested match
+(a(b(c))(d)) abcd /mob 0: <abcd @ 0>/ nested match
+(a(b(c))(d)) abcd /mob 0 0: <bc @ 1>/ nested match
+(a(b(c))(d)) abcd /mob 0 0 0: <c @ 2>/ nested match
+(a(b(c))(d)) abcd /mob 0 1: <d @ 3>/ nested match
+((\w+)+) abcd /mob: <abcd @ 0>/ nested match
+((\w+)+) abcd /mob 0: <abcd @ 0>/ nested match
+((\w+)+) abcd /mob 0 0 0: <abcd @ 0>/ nested match
+((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob: <ABCD/ nested match
+((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob 0: <ABCD/ nested match
+((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob 0 0 0: <ABCD/ nested match
+(a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 0: <a @ 0>/ alt subpattern before group
+(a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 1: <bc @ 1>/ alt subpattern in group
+(a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 2: <d @ 3>/ alt subpattern in group
+(a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 3: <g @ 6>/ alt subpattern after group
+(a) [ (bc) (x) | .* (ef) ] .* (g) abcdefg /mob 1: <ef @ 4>/ 2nd alt subpattern in group
+(a) [ (bc) (x) | .* (ef) ] .* (g) abcdefg /mob 3: <g @ 6>/ 2nd alt subpattern after group
+( (.) )* abc /mob 0 1 0: <b @ 1>/ nested repeated captures
+[ (.) ]* abc /mob 0 1: <b @ 1>/ nested repeated captures
+( [.] )* abc /mob 0 1: <b @ 1>/ nested repeated captures
+(.) (.) $7=(.) (.) $4=(.) abcdefg /mob 0: <a @ 0>/ numbered aliases $1
+(.) (.) $7=(.) (.) $4=(.) abcdefg /mob 1: <b @ 1>/ numbered aliases $2
+(.) (.) $7=(.) (.) $4=(.) abcdefg /mob 7: <c @ 2>/ numbered aliases $7
+(.) (.) $7=(.) (.) $4=(.) abcdefg /mob 8: <d @ 3>/ numbered aliases $8
+(.) (.) $7=(.) (.) $4=(.) abcdefg /mob 4: <e @ 4>/ numbered aliases $4
+$1=[ (.) (.) (.) ] (.) abcdefg /mob 1: <abc @ 0>/ perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.) abcdefg /mob 2: <a @ 0>/ perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.) abcdefg /mob 3: <b @ 1>/ perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.) abcdefg /mob 4: <c @ 2>/ perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.) abcdefg /mob 5: <d @ 3>/ perl5 numbered captures $1
+# todo :pugs<feature>
+:s $<key>=[\w+] \= $<val>=[\S+] abc = 123 /mob<key>: <abc @ 1>/ named capture
+# todo :pugs<feature>
+:s $<key>=[\w+] \= $<val>=[\S+] abc = 123 /mob<val>: <123 @ 7>/ named capture
+# todo :pugs<feature>
+:s (\w+) $<foo>=(\w+) (\w+) abc def ghi /mob<foo>: <def @ 4>/ mixing named and unnamed capture
+# todo :pugs<feature>
+:s (\w+) $<foo>=(\w+) (\w+) abc def ghi /mob 1: <ghi @ 8>/ mixing named and unnamed capture
+# todo :pugs<feature>
+<alpha> [ \- <alpha> ]? abc def ghi /mob<alpha> 0: <a @ 0>/ multiple subrule captures in same scope
+# todo :pugs<feature>
+[(.)$0]+ bookkeeper y backreference
+# todo :pugs<feature>
+(\w+) <+ws> $0 hello hello y backreference at end of string
+# todo :pugs<feature>
+[(.)$0]+ bookkeeper /mob 0 0: <o @ 1>/ backref $1
+# todo :pugs<feature>
+[(.)$0]+ bookkeeper /mob 0 1: <k @ 3>/ backref $1
+# todo :pugs<feature>
+[(.)$0]+ bookkeeper /mob 0 2: <e @ 5>/ backref $1
+# todo :pugs<feature>
+(.)*x 123x /mob: <123x @ 0>/ repeated dot capture
+
+$<key>=<alpha> 12ab34 /mob<key>: <a @ 2>/ alias capture
+<key=alpha> 12ab34 /mob<key>: <a @ 2>/ alias capture
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
82 t/perl6regex/rx_charclass
@@ -0,0 +1,82 @@
+## Enumerated character lists
+<[c]> abcdef y character class
+# todo :pugs<feature>
+<[ z ]> abc def n character class ignores ws
+# todo :pugs<feature>
+<[dcb]>**{3} abcdef y repeated character class
+^<[a]> abcdef y anchored character class
+<-[e]> abcdef y negated character class
+^<[a]>? abcdef y anchored optional character class
+<-[e]>? abcdef y negated optional character class
+<-[dcb]>**{3} abcdef n repeated negated character class
+^<-[e]> abcdef y anchored negated character class
+^<-[a]> abcdef n anchored negated character class
+<[b..d]> abcdef y character range
+# todo :pugs<feature>
+<[b .. d]> c y character range ignores ws
+<[b..d]> abxxef y character range
+<[b..d]> axcxef y character range
+<[b..d]> axxdef y character range
+<[b..d]> axxxef n character range
+<-[b..d]> abcdef y negated character range
+# todo :pugs<feature>
+<- [b..d]> abcdef y negated allows ws
+<-[b..d]> bbccdd n negated character range
+# todo :pge<reversed character range>
+<-[d..b]> bbccdd /parse error/ illegal character range
+<[-]> ab-def /parse error/ unescaped hyphen
+<[\-]> ab-def y escaped hyphen
+<[\-]> abcdef n escaped hyphen
+<-[\-]> ---x-- y negated escaped hyphen
+<-[\-]> ------ n negated escaped hyphen
+<[\-+]> ab-def y escaped hyphen in range
+<[\-+]> ab+def y escaped hyphen in range
+<[\-+]> abcdef n escaped hyphen in range
+<[+\-]> ab-def y escaped hyphen in range
+<[+\-]> ab+def y escaped hyphen in range
+<[+\-]> abcdef n escaped hyphen in range
+<-[\-+]> ---x-- y negated escaped hyphen in range
+<-[\-+]> ------ n negated escaped hyphen in range
+<-[+\-]> ---x-- y negated escaped hyphen in range
+<-[+\-]> ------ n negated escaped hyphen in range
+<["\\]> \\ y escaped backslash
+<[\]]> ] y escaped close bracket
+<[\]> \\]] /parse error/ unescaped backslash (or no closing brace)
+^\><[<]> >< y lt character class
+^<[>]>\< >< y gt character class
+# todo :pugs<feature>
+^<[><]>**{2} >< y gt, lt character class
+# todo :pugs<feature>
+^<[<>]>**{2} >< y lt, gt character class
+^<-[><]> >< n not gt, lt character class
+^<-[<>]> >< n not lt, gt character class
+'... --- ...' ... --- ... y literal match (\')
+'... --- ...' ...---... n literal match (\')
+# todo :pugs<feature>
+'ab\'>cd' ab'>cd y literal match with quote
+'ab\\yz' ab\x5cyz y literal match with backslash
+'ab"cd' ab"cd y literal match with quote
+# todo :pugs<feature>
+'ab\\yz' ab\x5cyz y literal match with backslash
+# todo :pugs<feature> :pge<feature>
+"... --- ..." ... --- ... y literal match (\")
+# todo :pugs<feature> :pge<feature>
+"... --- ..." ...---... n literal match (\")
+# todo :pugs<feature> :pge<feature>
+"ab<\">cd" ab<">cd y literal match with quote
+# todo :pugs<feature> :pge<feature>
+"ab<'>cd" ab<'>cd y literal match with quote
+# todo :pugs<feature> :pge<feature>
+"ab\\cd" ab\x5ccd y literal match with backslash
+# todo :pugs<feature> :pge<feature>
+(ab)x"$0" abxab y literal match with interpolation
+# todo :pugs<feature> :pge<feature>
+(ab)"x$0" abxab y literal match with interpolation
+'?' ab<? y literal match with question mark
+'<' ab<? y literal match with lt
+'<?' ab<? y literal match with lt and question mark
+'<?' ab<x? n non-matching literal match
+<[A..Z0..9]> abcdef n two enumerated ranges
+<[A..Z0..9]> abcDef y two enumerated ranges
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
12 t/perl6regex/rx_goal
@@ -0,0 +1,12 @@
+## Goal tests
+'(' ~ ')' \d+ (123) y basic goal syntax
+'(' ~ ')' \d+ (123 /couldn't find final/ missing goal
+'(' ~ ')' \d+ (123abc) /couldn't find final/ stuff before goal
+'(' ~ ')' \d+ (abc) n can't match internal stuff
+'(' ~ ')' \d+ () n missing internal stuff
+['('] ~ [')'] [\d \d+] (123) y goal syntax with brackets
+('(') ~ (')') (\d \d+) (123) y goal syntax with parenthesis
+'(' ~ <[()]> \d+ (123) y non-literal goal
+'(' ~ <[()]> \d+ (123( y non-literal goal
+'(' ~ <[()]> \d+ (123] /Unable to parse/ failing non-literal goal
+:dba('zz') '(' ~ ')' \d+ (123 /zz/ :dba adverb
48 t/perl6regex/rx_lookarounds
@@ -0,0 +1,48 @@
+## lookarounds
+<before .d> a. abacad /mob: <ad @ 4>/ lookahead <before>
+<before c> .... abacad n lookahead <before>
+<before> . abcd n null <before>
+<!before ..b> aa aabaaa /mob: <aa @ 3>/ negated lookahead
+# todo :pugs<feature>
+<after a>b ab y lookbehind <after>
+<after a>b cb n lookbehind <after>
+<after a>b b n lookbehind <after>
+# todo :pugs<feature>
+<!after c>b ab y lookbehind <!after>
+<!after c>b cb n lookbehind <!after>
+# todo :pugs<feature>
+<!after c>b b y lookbehind <!after>
+<!after <[cd]>>b dbcb n lookbehind <!after>
+# todo :pugs<feature>
+<!after <[cd]>><[ab]> dbaacb y lookbehind <!after>
+<!after c|d>b dbcb n lookbehind <!after>
+# todo :pugs<feature>
+<!after c|d><[ab]> dbaacb y lookbehind <!after>
+# todo :pugs<feature>
+<!after cd><[ab]> cbaccb y lookbehind <!after>
+# todo :pugs<feature>
+$ <after ^a> a y lookbehind <after>
+# todo :pugs<feature>
+<after x+>y axxbxxyc y lookbehind <after>
+<[a..z]>+ az y metasyntax with leading + (<+...>)
+<+[a..z]>+ az y metasyntax with leading + (<+...>)
+<+alpha>+ az y metasyntax with leading + (<+...>)
+
+<?> '' y null pattern (<?>)
+^ <?> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)
+<?> $ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)
+abc <?> def \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)
+x | y | <?> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)
+x | y | <?> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)
+
+abc <!> def \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij n fail pattern <!>
+
+a[b} \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /rule error/ mismatched close
+
+c <before .d> abacad /mob: <c @ 3>/ one character and lookahead <before>
+.* <before .d> abacad /mob: <abac @ 0>/ multiple characters and lookahead <before>
+.* <before .\<> abaca<d /mob: <abac @ 0>/ multiple characters and lookahead <before> with a '<'
+.* <before \<> aba<ca<d /mob: <aba<ca @ 0>/ greedy any character and lookahead <before> with a '<'
+.*? <before \<> aba<ca<d /mob: <aba @ 0>/ non-greedy any character and lookahead <before> with a '<'
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
263 t/perl6regex/rx_metachars
@@ -0,0 +1,263 @@
+## Metacharacter tests
+. a y dot (.)
+. \n y dot (.)
+. '' n dot (.)
+a\s+f abcdef n whitespace (\s)
+ab\s+cdef ab cdef y whitespace (\s)
+a\S+f abcdef y not whitespace (\S)
+a\S+f ab cdef n not whitespace (\S)
+^ abc abcdef y start and end of string (^)
+^ abc abc\ndef y start and end of string (^)
+^ abc def\nabc n start and end of string (^)
+def \n ^ abc def\nabc n start and end of string (^)
+def $ abcdef y start and end of string ($)
+def $ abc\ndef y start and end of string ($)
+def $ def\nabc n start and end of string ($)
+def $ \n abc def\nabc n start and end of string (^)
+abc \n $ abc\n y end of string ($)
+abc $ abc\n n end of string ($)
+<<def abc-def y left word boundary, beginning of word
+<<bc abc-def n left word boundary, mid-word
+c<< abc-def n left word boundary, end of word
+<<abc abc-def y left word boundary, BOS
+def<< abc-def n left word boundary, EOS
+<< ------- n left word boundary, no word chars
+>>def abc-def n right word boundary, beginning of word
+>>bc abc-def n right word boundary, mid-word
+c>> abc-def y right word boundary, end of word
+>>abc abc-def n right word boundary, BOS
+def>> abc-def y right word boundary, EOS
+>> ------- n right word boundary, no word chars
+
+c \n d abc\ndef y logical newline (\n)
+# todo :pugs<feature>
+c \n d abc\rdef y logical newline matches \r
+c \n+ d abc\n\ndef y logical newline quantified
+a\n+f abcdef n logical newline (\n)
+c \n d abc\n\rdef n logical newline matches \n\r
+# todo :pugs<feature>
+c \n d abc\r\ndef y logical newline matches \r\n
+b \n c abc\ndef n logical newline (\n)
+\N a y not logical newline (\N)
+a \N c abc y not logical newline (\N)
+\N '' n not logical newline (\N)
+c \N d abc\ndef n not logical newline (\N)
+c \N d abc\rdef n not logical newline (\N)
+c \N+ d abc\n\ndef n not logical newline (\N)
+a\N+f abcdef y not logical newline (\N)
+c \N d abc\n\rdef n not logical newline (\N)
+c \N d abc\r\ndef n not logical newline (\N)
+b \N \n abc\ndef y not logical newline (\N)
+\Aabc Aabc /reserved/ retired metachars (\A)
+\Aabc abc\ndef /reserved/ retired metachars (\A)
+abc\Z abcZ /reserved/ retired metachars (\Z)
+abc\Z abc\ndef /reserved/ retired metachars (\Z)
+abc\z abcz /reserved/ retired metachars (\z)
+def\z abc\ndef /reserved/ retired metachars (\z)
+abc # def abc#def y comments (#)
+abc # xyz abc#def y comments (#)
+abc # def \n \$ abc#def y comments (#)
+abc \# def abc#def y comments (#)
+abc \# xyz abc#def n comments (#)
+^ abc \# def $ abc#def y comments (#)
+^^ abc \n ^^ def abc\ndef y line beginnings and endings (^^)
+# todo :pugs<feature>
+^^ abc \n ^^ def \n ^^ abc\ndef\n n line beginnings and endings (^^)
+^^ \n \n y line beginnings and endings (^^)
+# todo :pugs<feature>
+\n ^^ \n n line beginnings and endings (^^)
+abc $$ \n def $$ abc\ndef y line beginnings and endings ($$)
+# todo :pugs<feature>
+abc $$ \n def $$ \n $$ abc\ndef\n n line beginnings and endings ($$)
+$$ \n \n y line beginnings and endings ($$)
+# todo :pugs<feature>
+\n $$ \n n line beginnings and endings ($$)
+<[a..d]> | <[b..e]> c y alternation (|)
+<[a..d]> | <[d..e]> c y alternation (|)
+<[a..b]> | <[b..e]> c y alternation (|)
+<[a..b]> | <[d..e]> c n alternation (|)
+<[a..d]>+ | <[b..e]>+ bcd y alternation (|)
+^ [ <[a..d]>+ | <[b..e]>+ ] $ bcd y alternation (|)
+^ [ <[a..c]>+ | <[b..e]>+ ] $ bcd y alternation (|)
+^ [ <[a..d]>+ | <[c..e]>+ ] $ bcd y alternation (|)
+b| bcd /rule error/ alternation (|) - null right arg illegal
+|b bcd y alternation (|) - null left arg ignored
+| bcd /rule error/ alternation (|) - null both args illegal
+\| | y alternation (|) - literal must be escaped
+| | /rule error/ alternation (|) - literal must be escaped
+# todo :pugs<feature>
+<[a..d]> & <[b..e]> c y conjunction (&)
+<[a..d]> & <[d..e]> c n conjunction (&)
+<[a..b]> & <[b..e]> c n conjunction (&)
+<[a..b]> & <[d..e]> c n conjunction (&)
+# todo :pugs<feature>
+<[a..d]>+ & <[b..e]>+ bcd y conjunction (&)
+# todo :pugs<feature>
+^ [ <[a..d]>+ & <[b..e]>+ ] $ bcd y conjunction (&)
+# todo :pugs<feature>
+<[a..c]>+ & <[b..e]>+ bcd y conjunction (&)
+# todo :pugs<feature>
+<[a..d]>+ & <[c..e]>+ bcd y conjunction (&)
+b& bcd /rule error/ conjunction (&) - null right arg illegal
+&b bcd /rule error/ conjunction (&) - null left arg illegal
+& bcd /rule error/ conjunction (&) - null both args illegal
+\& & y conjunction (&) - literal must be escaped
+& & /rule error/ conjunction (&) - literal must be escaped
+# todo :pge<leading |>
+a&|b a&|b /rule error/ alternation and conjunction (&|) - parse error
+a|&b a|&b /rule error/ alternation and conjunction (|&) - parse error
+|d|b abc y leading alternation ignored
+ |d|b abc y leading alternation ignored
+|d |b abc y leading alternation ignored
+ | d | b abc y leading alternation ignored
+# todo :pugs<feature> :pge<feature>
+ b | | d abc n null pattern invalid
+\pabc pabc /reserved/ retired metachars (\p)
+\p{InConsonant} a /reserved/ retired metachars (\p)
+\Pabc Pabc /reserved/ retired metachars (\P)
+\P{InConsonant} a /reserved/ retired metachars (\P)
+\Labc\E LabcE /reserved/ retired metachars (\L...\E)
+\LABC\E abc /reserved/ retired metachars (\L...\E)
+\Uabc\E UabcE /reserved/ retired metachars (\U...\E)
+\Uabc\E ABC /reserved/ retired metachars (\U...\E)
+\Qabc\E QabcE /reserved/ retired metachars (\Q...\E)
+\Qabc d?\E abc d /reserved/ retired metachars (\Q...\E)
+\Gabc Gabc /reserved/ retired metachars (\G)
+\1abc 1abc /reserved/ retired metachars (\1)
+# todo :pugs<feature>
+^ \s+ $ \x0009\x0020\x00a0\x000a\x000b\x000c\x000d\x0085 y 0-255 whitespace (\s)
+# todo :pugs<feature>
+^ \h+ $ \x0009\x0020\x00a0 y 0-255 horizontal whitespace (\h)
+^ \V+ $ \x0009\x0020\x00a0 y 0-255 horizontal whitespace (\V)
+# todo :pugs<feature>
+^ \v+ $ \x000a\x000b\x000c\x000d\x0085 y 0-255 vertical whitespace (\v)
+^ \h+ $ \x000a\x000b\x000c\x000d\x0085 n 0-255 horizontal whitespace (\h)
+^ \v+ $ \x0009\x0020\x00a0 n 0-255 vertical whitespace (\v)
+# todo :pugs<feature>
+^ \s+ $ \x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000 y unicode whitespace (\s)
+# todo :pugs<feature>
+^ \h+ $ \x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000 y unicode whitespace (\h)
+^ \V+ $ \x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000 y unicode whitespace (\V)
+^ \v+ $ \x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000 n unicode whitespace (\v)
+c \t d abc\tdef y horizontal tab (\t)
+c \t+ d abc\t\tdef y horizontal tab (\t)
+a \t+ f abcdef n horizontal tab (\t)
+b \t c abc\tdef n horizontal tab (\t)
+\T a y not horizontal tab (\T)
+a \T c abc y not horizontal tab (\T)
+\T '' n not horizontal tab (\T)
+c \T d abc\tdef n not horizontal tab (\T)
+c \T+ d abc\t\tdef n not horizontal tab (\T)
+a \T+ f abcdef y not horizontal tab (\T)
+c \r d abc\rdef y return (\r)
+c \r+ d abc\r\rdef y return (\r)
+a \r+ f abcdef n return (\r)
+b \r c abc\rdef n return (\r)
+\R a y not return (\R)
+a \R c abc y not return (\R)
+\R '' n not return (\R)
+c \R d abc\rdef n not return (\R)
+c \R+ d abc\r\rdef n not return (\R)
+a \R+ f abcdef y not return (\R)
+c \f d abc\fdef y formfeed (\f)
+c \f+ d abc\f\fdef y formfeed (\f)
+a \f+ f abcdef n formfeed (\f)
+b \f c abc\fdef n formfeed (\f)
+\F a y not formfeed (\F)
+a \F c abc y not formfeed (\F)
+\F '' n not formfeed (\F)
+c \F d abc\fdef n not formfeed (\F)
+c \F+ d abc\f\fdef n not formfeed (\F)
+a \F+ f abcdef y not formfeed (\F)
+# todo :pugs<feature>
+c \e d abc\edef y escape (\e)
+# todo :pugs<feature>
+c \e+ d abc\e\edef y escape (\e)
+a \e+ f abcdef n escape (\e)
+b \e c abc\edef n escape (\e)
+\E a y not escape (\E)
+a \E c abc y not escape (\E)
+\E '' n not escape (\E)
+# todo :pugs<feature>
+c \E d abc\edef n not escape (\E)
+# todo :pugs<feature>
+c \E+ d abc\e\edef n not escape (\E)
+a \E+ f abcdef y not escape (\E)
+c \x0021 d abc!def y hex (\x)
+c \x0021+ d abc!!def y hex (\x)
+a \x0021+ f abcdef n hex (\x)
+b \x0021 c abc!def n hex (\x)
+c \x[0021] d abc!def y hex (\x[])
+c \x[0021]+ d abc!!def y hex (\x[])
+c \x[21,21] d abc!!def y hex (\x[])
+c \x[21, 21] d abc!!def y hex (\x[])
+c \x[ 21 , 21 ] d abc!!def y hex (\x[])
+a \x[0021]+ f abcdef n hex (\x[])
+b \x[0021] c abc!def n hex (\x[])
+\X0021 a y not hex (\X)
+a \X0021 c abc y not hex (\X)
+\X0021 '' n not hex (\X)
+c \X0021 d abc!def n not hex (\X)
+c \X0021+ d abc!!def n not hex (\X)
+a \X0021+ f abcdef y not hex (\X)
+\X[0021] a y not hex (\X[])
+a \X[0021] c abc y not hex (\X[])
+\X[0021] '' n not hex (\X[])
+c \X[0021] d abc!def n not hex (\X[])
+c \X[0021]+ d abc!!def n not hex (\X[])
+a \X[0021]+ f abcdef y not hex (\X[])
+c \c33 d abc!def y hex (\x)
+c \c33+ d abc!!def y hex (\x)
+a \c33+ f abcdef n hex (\x)
+b \c33 c abc!def n hex (\x)
+c \c[33] d abc!def y hex (\x[])
+c \c[33]+ d abc!!def y hex (\x[])
+c \c[33,33] d abc!!def y hex (\x[])
+c \c[ 33, 33] d abc!!def y hex (\x[])
+c \c[ 33 , 33 ] d abc!!def y hex (\x[])
+a \c[33]+ f abcdef n hex (\x[])
+b \c[33] c abc!def n hex (\x[])
+\C33 a y not hex (\X)
+a \C33 c abc y not hex (\X)
+\C33 '' n not hex (\X)
+c \C33 d abc!def n not hex (\X)
+c \C33+ d abc!!def n not hex (\X)
+a \C33+ f abcdef y not hex (\X)
+\C[33] a y not hex (\X[])
+a \C[33] c abc y not hex (\X[])
+\C[33] '' n not hex (\X[])
+c \C[33] d abc!def n not hex (\X[])
+c \C[33]+ d abc!!def n not hex (\X[])
+a \C[33]+ f abcdef y not hex (\X[])
+c \o041 d abc!def y octal (\o)
+c \o41+ d abc!!def y octal (\o)
+a \o41+ f abcdef n octal (\o)
+b \o41 c abc!def n octal (\o)
+c \o[41] d abc!def y octal (\o[])
+c \o[41]+ d abc!!def y octal (\o[])
+# todo :pugs<feature>
+c \o[41,41] d abc!!def y octal (\o[])
+a \o[41]+ f abcdef n octal (\o[])
+b \o[41] c abc!def n octal (\o[])
+\O41 a y not octal (\O)
+a \O41 c abc y not octal (\O)
+\O41 '' n not octal (\O)
+c \O41 d abc!def n not octal (\O)
+c \O41+ d abc!!def n not octal (\O)
+a \O41+ f abcdef y not octal (\O)
+\O[41] a y not octal (\O[])
+a \O[41] c abc y not octal (\O[])
+\O[41] '' n not octal (\O[])
+c \O[41] d abc!def n not octal (\O[])
+c \O[41]+ d abc!!def n not octal (\O[])
+a \O[41]+ f abcdef y not octal (\O[])
+a\w+f a=[ *f n word character
+a\w+f abcdef y word character
+a\W+f a&%- f y not word character
+a\W+f abcdef n not word character
+a\d+f abcdef n digit
+ab\d+cdef ab42cdef y digit
+a\D+f abcdef y not digit
+a\D+f ab0cdef n not digit
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
154 t/perl6regex/rx_modifiers
@@ -0,0 +1,154 @@
+## modifiers
+:i bcd abcdef y ignorecase (:i)
+:i bcd aBcdef y ignorecase (:i)
+:i bcd abCdef y ignorecase (:i)
+:i bcd abcDef y ignorecase (:i)
+:i bcd abc-ef n ignorecase (:i)
+:ignorecase bcd abcdef y ignorecase (:ignorecase)
+:ignorecase bcd aBCDef y ignorecase (:ignorecase)
+:ignorecase bcd abc-ef n ignorecase (:ignorecase)
+# todo :pugs<feature>
+:i(0) bcd abcdef y ignorecase, repetition (:i(0))
+:i(0) bcd abCdef n ignorecase, repetition (:i(0))
+# todo :pugs<feature>
+:i(1) bcd abcdef y ignorecase, repetition (:i(1))
+# todo :pugs<feature>
+:i(1) bcd abCdef y ignorecase, repetition (:i(1))
+:i(1) bcd aBxDef n ignorecase, repetition (:i(1))
+# todo :pugs<feature>
+:0i bcd abcdef y ignorecase, repetition (:0i)
+:0i bcd abCdef n ignorecase, repetition (:0i)
+# todo :pugs<feature>
+:1i bcd abcdef y ignorecase, repetition (:1i)
+# todo :pugs<feature>
+:1i bcd abCdef y ignorecase, repetition (:1i)
+# todo :pugs<feature>
+:1i bcd aBCDef y ignorecase, repetition (:1i)
+:1i bcd aBxDef n ignorecase, repetition (:1i)
+ab [:i cd ] ef abcdef y ignorecase, lexical (:i)
+ab [:i cd ] ef abCdef y ignorecase, lexical (:i)
+ab [:i cd ] ef abcDef y ignorecase, lexical (:i)
+ab [:i cd ] ef abCDef y ignorecase, lexical (:i)
+ab [:i cd ] ef aBCDef n ignorecase, lexical (:i)
+ab [:i cd ] ef abCDEf n ignorecase, lexical (:i)
+:i ab [:i cd ] ef abCDef y ignorecase, lexical (:i)
+:i ab [:i cd ] ef AbCDeF y ignorecase, lexical (:i)
+:i ab [:i cd ] ef AbcdeF y ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i a [:i(0) b [:i(1) c [:0i d [:1i e [:i(0) f ] ] ] ] ] AbCdEf y ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i aa [:i(0) bb [:i(1) cc [:0i dd [:1i ee [:i(0) ff ] ] ] ] ] AabbCcddEeff y ignorecase, lexical (:i)
+:i a [:i(0) b [:i(1) c [:0i d [:1i e [:i(0) f ] ] ] ] ] AbCdEF n ignorecase, lexical (:i)
+:i aa [:i(0) bb [:i(1) cc [:0i dd [:1i ee [:i(0) ff ] ] ] ] ] AabbCcddEeFf n ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i ab [:i(0) cd ] ef AbcdeF y ignorecase, lexical repetition (:i)
+# todo :pugs<feature> :pge<feature>
+:i ab [:!i cd ] ef AbcdeF y ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i ab [:0i cd ] ef AbcdeF y ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:0i ab [:1i cd ] ef abCDef y ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef AbCDeF n ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef AbcdeF n ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:0i ab [:i(0) cd ] ef abcdef y ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef AbcdeF n ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(1) ab [:1i cd ] ef AbCdeF y ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(1) ab [:i(0) cd ] ef AbcdeF y ignorecase, lexical repetition (:i)
+:i(1) ab [:i(0) cd ] ef AbcDeF n ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(2) ab [:i(999) cd ] ef ABCDEF y ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:1i ab [:i(1) cd ] ef ABCDEF y ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef abcDeF n ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:2i ab [:999i cd ] ef ABCDEF y ignorecase, lexical repetition (:i)
+ab [:ignorecase cd ] ef abCDef y ignorecase, lexical (:ignorecase)
+ab [:ignorecase cd ] ef aBCDef n ignorecase, lexical (:ignorecase)
+# todo :pugs<feature>
+:1ignorecase ab [:ignorecase(1) cd ] ef ABCDEF y ignorecase, lexical repetition (:ignorecase)
+# todo :pugs<feature>
+:s bcd a bcdef y sigspace (:s)
+# todo :pugs<feature>
+:s bcd a bcd ef y sigspace (:s)
+:s bcd abcdef n sigspace (:s)
+:s bcd abcd ef n sigspace (:s)
+:s bcd ab cdef n sigspace (:s)
+# todo :pugs<feature>
+:s b c d a b c d ef y sigspace (:s)
+# todo :pugs<feature>
+:s b c d a b c def y sigspace (:s)
+:s b c d ab c d ef n sigspace (:s)
+:s b c d a bcdef n sigspace (:s)
+:s b c d abcdef n sigspace (:s)
+# todo :pugs<feature>
+:sigspace bcd a bcdef y sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace bcd a bcd ef y sigspace (:sigspace)
+:sigspace bcd abcdef n sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace b c d a b c d ef y sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace b c d a b c def y sigspace (:sigspace)
+:sigspace b c d ab c d ef n sigspace (:sigspace)
+# todo :pugs<feature>
+:s(1) b c [:s(0) d e f ] a b c def y sigspace, lexical repetition (:s)
+# todo :pugs<feature> :pge<feature>
+:s b c [:!s d e f ] a b c def y sigspace, lexical repetition (:s)
+:s(0) b c [:s(1) d e f ] a b c def n sigspace, lexical repetition (:s)
+# todo :pge<feature>
+:!s b c [:s d e f ] a b c def n sigspace, lexical repetition (:s)
+:s(0) b c [:s(0) d e f ] a b c def n sigspace, lexical repetition (:s)
+# todo :pge<feature>
+:!s b c [:!s d e f ] a b c def n sigspace, lexical repetition (:s)
+# todo :pugs<feature>
+:s ab ab y sigspace, trailing ws
+foo\s*'-'?\s*bar foo\t \n-\n\t bar y basic match
+foo\s*'-'?\s*bar foo - bar y basic match
+foo\s+'-'?\s*bar foo bar y basic match \s+ \s*
+foo\s+'-'?\s*bar foo -bar y basic match \s+ \s*
+foo\s*'-'?\s+bar foo- bar y basic match \s* \s+
+foo '-'? bar foo-bar y basic match \s* \s*
+foo '-'? bar foobar y basic match
+foo '-'? bar foo - bar n basic non-match
+# todo :pugs<feature>
+:s foo '-'? bar foo\n \t- \t\t\nbar y basic ws match
+# todo :pugs<feature>
+:s foo '-'? bar foo - bar y basic ws match
+# todo :pugs<feature>
+:s foo '-'? bar foo bar y basic ws match \s+ \s*
+# todo :pugs<feature>
+:s foo '-'? bar foo -bar y basic ws match \s+ \s*
+# todo :pugs<feature>
+:s foo '-'? bar foo- bar y basic ws match \s* \s+
+# todo :pugs<feature>
+:s foo '-'? bar foo-bar y basic ws match \s* \s*
+:s foo '-'? bar foobar n basic ws non-match
+:s()foo '-'? bar foo - bar n basic ws match
+# todo :pugs<feature> :pge<feature>
+:s[]foo '-'? bar foo - bar y basic ws match
+# todo :pugs<feature>
+:s<?wb>foo '-'? bar foo - bar y basic ws match with boundary modifier separation
+# todo :pugs<feature>
+:s::foo '-'? bar foo - bar y basic ws match with backtrack no-op modifier separation
+:s::(\w+) ':=' (\S+) dog := spot /mob 0: <dog @ 0>/ sigspace and capture together
+:s::(\w+) ':=' (\S+) dog := spot /mob 1: <spot @ 7>/ sigspace and capture together
+# todo :pugs<feature> :pge<feature>
+:perl5 \A.*? bcd\Q$\E..\z a bcd$ef y perl5 syntax (:perl5)
+# todo :pugs<feature>
+:x(6) \d 123456 y repetition (:x)
+# todo :pugs<feature>
+:x(3) \d 123456 y repetition (:x)
+# todo :pugs<feature>
+:x(0) \d 123456 y repetition (:x)
+# todo :pugs<feature>
+:nth(3) a \d a1a2a3 y nth occurance (:nth)
+# todo :pge<feature>
+:nth(4) a \d a1a2a3 n nth occurance (:nth)
+# todo :pge<feature>
+:nth(0) a \d a1a2a3 n nth occurance (:nth)
+:s^[\d+ ]* abc 11 12 13 abc y <?ws> before closing bracket
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
210 t/perl6regex/rx_quantifiers
@@ -0,0 +1,210 @@
+## Quantifiers
+
+xa* xaaaay /<xaaaa @ 0>/ star 2+
+xa* xay /<xa @ 0>/ star 1
+xa* xy /<x @ 0>/ star 0
+xa*y xaaaay /<xaaaay @ 0>/ star 2+
+xa*y xay /<xay @ 0>/ star 1
+xa*y xy /<xy @ 0>/ star 0
+
+xa+ xaaaay /<xaaaa @ 0>/ plus 2+
+xa+ xay /<xa @ 0>/ plus 1
+xa+ xy n plus 0
+xa+y xaaaay /<xaaaay @ 0>/ plus 2+
+xa+y xay /<xay @ 0>/ plus 1
+xa+y xy n plus 0
+
+xa? xaaaay /<xa @ 0>/ ques 2+
+xa? xay /<xa @ 0>/ ques 1
+xa? xy /<x @ 0>/ ques 0
+xa?y xaaaay n ques 2+
+xa?y xay /<xay @ 0>/ ques 1
+xa?y xy /<xy @ 0>/ ques 0
+
+xa*! xaaaay /<xaaaa @ 0>/ star greedy 2+
+xa*! xay /<xa @ 0>/ star greedy 1
+xa*! xy /<x @ 0>/ star greedy 0
+xa*!y xaaaay /<xaaaay @ 0>/ star greedy 2+
+xa*!y xay /<xay @ 0>/ star greedy 1
+xa*!y xy /<xy @ 0>/ star greedy 0
+
+xa+! xaaaay /<xaaaa @ 0>/ plus greedy 2+
+xa+! xay /<xa @ 0>/ plus greedy 1
+xa+! xy n plus greedy 0
+xa+!y xaaaay /<xaaaay @ 0>/ plus greedy 2+
+xa+!y xay /<xay @ 0>/ plus greedy 1
+xa+!y xy n plus greedy 0
+
+xa?! xaaaay /<xa @ 0>/ ques greedy 2+
+xa?! xay /<xa @ 0>/ ques greedy 1
+xa?! xy /<x @ 0>/ ques greedy 0
+xa?!y xaaaay n ques greedy 2+
+xa?!y xay /<xay @ 0>/ ques greedy 1
+xa?!y xy /<xy @ 0>/ ques greedy 0
+
+xa*:! xaaaay /<xaaaa @ 0>/ star :greedy 2+
+xa*:! xay /<xa @ 0>/ star :greedy 1
+xa*:! xy /<x @ 0>/ star :greedy 0
+xa*:!y xaaaay /<xaaaay @ 0>/ star :greedy 2+
+xa*:!y xay /<xay @ 0>/ star :greedy 1
+xa*:!y xy /<xy @ 0>/ star :greedy 0
+
+xa+:! xaaaay /<xaaaa @ 0>/ plus :greedy 2+
+xa+:! xay /<xa @ 0>/ plus :greedy 1
+xa+:! xy n plus :greedy 0
+xa+:!y xaaaay /<xaaaay @ 0>/ plus :greedy 2+
+xa+:!y xay /<xay @ 0>/ plus :greedy 1
+xa+:!y xy n plus :greedy 0
+
+xa?:! xaaaay /<xa @ 0>/ ques :greedy 2+
+xa?:! xay /<xa @ 0>/ ques :greedy 1
+xa?:! xy /<x @ 0>/ ques :greedy 0
+xa?:!y xaaaay n ques :greedy 2+
+xa?:!y xay /<xay @ 0>/ ques :greedy 1
+xa?:!y xy /<xy @ 0>/ ques :greedy 0
+
+xa*? xaaaay /<x @ 0>/ star eager 2+
+xa*? xay /<x @ 0>/ star eager 1
+xa*? xy /<x @ 0>/ star eager 0
+xa*?y xaaaay /<xaaaay @ 0>/ star eager 2+
+xa*?y xay /<xay @ 0>/ star eager 1
+xa*?y xy /<xy @ 0>/ star eager 0
+
+xa+? xaaaay /<xa @ 0>/ plus eager 2+
+xa+? xay /<xa @ 0>/ plus eager 1
+xa+? xy n plus eager 0
+xa+?y xaaaay /<xaaaay @ 0>/ plus eager 2+
+xa+?y xay /<xay @ 0>/ plus eager 1
+xa+?y xy n plus eager 0
+
+xa?? xaaaay /<x @ 0>/ ques eager 2+
+xa?? xay /<x @ 0>/ ques eager 1
+xa?? xy /<x @ 0>/ ques eager 0
+xa??y xaaaay n ques eager 2+
+xa??y xay /<xay @ 0>/ ques eager 1
+xa??y xy /<xy @ 0>/ ques eager 0
+
+xa*:? xaaaay /<x @ 0>/ star :eager 2+
+xa*:? xay /<x @ 0>/ star :eager 1
+xa*:? xy /<x @ 0>/ star :eager 0
+xa*:?y xaaaay /<xaaaay @ 0>/ star :eager 2+
+xa*:?y xay /<xay @ 0>/ star :eager 1
+xa*:?y xy /<xy @ 0>/ star :eager 0
+
+xa+:? xaaaay /<xa @ 0>/ plus :eager 2+
+xa+:? xay /<xa @ 0>/ plus :eager 1
+xa+:? xy n plus :eager 0
+xa+:?y xaaaay /<xaaaay @ 0>/ plus :eager 2+
+xa+:?y xay /<xay @ 0>/ plus :eager 1
+xa+:?y xy n plus :eager 0
+
+xa?:? xaaaay /<x @ 0>/ ques :eager 2+
+xa?:? xay /<x @ 0>/ ques :eager 1
+xa?:? xy /<x @ 0>/ ques :eager 0
+xa?:?y xaaaay n ques :eager 2+
+xa?:?y xay /<xay @ 0>/ ques :eager 1
+xa?:?y xy /<xy @ 0>/ ques :eager 0
+
+xa*:y xaaaay /<xaaaay @ 0>/ star cut 2+
+xa*:y xay /<xay @ 0>/ star cut 1
+xa*:y xy /<xy @ 0>/ star cut 0
+xa*:a xaaaay n star cut 2+
+xa*:a xay n star cut 1
+
+xa+:y xaaaay /<xaaaay @ 0>/ plus cut 2+
+xa+:y xay /<xay @ 0>/ plus cut 1
+xa+:y xy n plus cut 0
+xa+:a xaaaay n plus cut 2+
+xa+:a xay n plus cut 1
+
+xa?:y xaaaay n ques cut 2+
+xa?:y xay /<xay @ 0>/ ques cut 1
+xa?:y xy /<xy @ 0>/ ques cut 0
+xa?:a xaaaay /<xaa @ 0> ques cut 2+
+xa?:a xay n ques cut 1
+
+:ratchet xa*y xaaaay /<xaaaay @ 0>/ star ratchet 2+
+:ratchet xa*y xay /<xay @ 0>/ star ratchet 1
+:ratchet xa*y xy /<xy @ 0>/ star ratchet 0
+:ratchet xa*a xaaaay n star ratchet 2+
+:ratchet xa*a xay n star ratchet 1
+
+:ratchet xa+y xaaaay /<xaaaay @ 0>/ plus ratchet 2+
+:ratchet xa+y xay /<xay @ 0>/ plus ratchet 1
+:ratchet xa+y xy n plus ratchet 0
+:ratchet xa+a xaaaay n plus ratchet 2+
+:ratchet xa+a xay n plus ratchet 1
+
+:ratchet xa?y xaaaay n ques ratchet 2+
+:ratchet xa?y xay /<xay @ 0>/ ques ratchet 1
+:ratchet xa?y xy /<xy @ 0>/ ques ratchet 0
+:ratchet xa?a xaaaay /<xaa @ 0> ques ratchet 2+
+:ratchet xa?a xay n ques ratchet 1
+
+:ratchet xa*!y xaaaay /<xaaaay @ 0>/ star ratchet greedy 2+
+:ratchet xa*!y xay /<xay @ 0>/ star ratchet greedy 1
+:ratchet xa*!y xy /<xy @ 0>/ star ratchet greedy 0
+:ratchet xa*!a xaaaay /<xaaaa @ 0>/ star ratchet greedy 2+
+:ratchet xa*!a xay /<xa @ 0>/ star ratchet greedy 1
+
+:ratchet xa+!y xaaaay /<xaaaay @ 0>/ plus ratchet greedy 2+
+:ratchet xa+!y xay /<xay @ 0>/ plus ratchet greedy 1
+:ratchet xa+!y xy n plus ratchet greedy 0
+:ratchet xa+!a xaaaay /<xaaaa @ 0>/ plus ratchet greedy 2+
+:ratchet xa+!a xay n plus ratchet greedy 1
+
+:ratchet xa?!y xaaaay n ques ratchet greedy 2+
+:ratchet xa?!y xay /<xay @ 0>/ ques ratchet greedy 1
+:ratchet xa?!y xy /<xy @ 0>/ ques ratchet greedy 0
+:ratchet xa?!a xaaaay /<xaa @ 0> ques ratchet greedy 2+
+:ratchet xa?!a xay /<xa @ 0> ques ratchet greedy 1
+
+
+## Quantifier closure
+.**{2} a n only one character
+.**{2} ab y two characters
+a**{2} foobar n only one "a" character
+a**{2} baabaa y two "a" characters
+a**{0..4} bbbbbbb y no "a" characters
+a**{2..4} bababab n not two consecutive "a" characters
+a**{2..4} baabbbb y two "a" characters
+a**{2..4} baaabbb y three "a" characters
+a**{2..4} baaaabb y four "a" characters
+a**{2..4} baaaaaa y four "a" characters
+a**{2..*} baaaaaa y six "a" characters
+a**?{2..*} baaaaaa y two "a" characters (non-greedy)
+a**:?{2..*} baaaaaa y two "a" characters (non-greedy)
+a**!{2..*} baaaaaa y six "a" characters (explicit greed)
+a**:!{2..*} baaaaaa y six "a" characters (explicit greed)
+a**?{2..4} baaabbb y two "a" characters (non-greedy)
+a**:?{2..4} baaabbb y two "a" characters (non-greedy)
+a**!{2..4} baaabbb y three "a" characters (explicit greed)
+a**:!{2..4} baaabbb y three "a" characters (explicit greed)
+
+## Quantifier bare range
+.**2 a n only one character
+.**2 ab y two characters
+a**2 foobar n only one "a" character
+a**2 baabaa y two "a" characters
+a**0..4 bbbbbbb y no "a" characters
+a**2..4 bababab n not two consecutive "a" characters
+a**2..4 baabbbb y two "a" characters
+a**2..4 baaabbb y three "a" characters
+a**2..4 baaaabb y four "a" characters
+a**2..4 baaaaaa y four "a" characters
+a**2..* baaaaaa y six "a" characters
+a**?2..* baaaaaa y two "a" characters (non-greedy)
+a**:?2..* baaaaaa y two "a" characters (non-greedy)
+a**!2..* baaaaaa y six "a" characters (explicit greed)
+a**:!2..* baaaaaa y six "a" characters (explicit greed)
+a**?2..4 baaabbb y two "a" characters (non-greedy)
+a**:?2..4 baaabbb y two "a" characters (non-greedy)
+a**!2..4 baaabbb y three "a" characters (explicit greed)
+a**:!2..4 baaabbb y three "a" characters (explicit greed)
+
+^\w+ ** ','$ foo,bar,baz y ** with a term
+^\w+ **? ',' ....$ foo,bar,baz y **? with a term
+^\w+ **[','\s*]$ foo, bar, baz y **? with term + ws
+:sigspace ^\w+ ** ',' $ foo, bar ,baz y **? under :sigspace
+:sigspace ^\w+**',' $ foo, bar ,baz n **? under :sigspace w/o ws
+:sigspace ^\w+**',' $ foo,bar,baz y **? under :sigspace w/o ws
67 t/perl6regex/rx_subrules
@@ -0,0 +1,67 @@
+## builtin subrules
+
+<ident> 2+3 ab2 /mob<ident>: <ab2 @ 4>/ capturing builtin <ident>
+<name> ab::cd::x3::42 /mob<name>: <ab::cd::x3 @ 0>/ capturing builtin <name>
+
+<.ident> 2+3 ab2 y non-capturing builtin <.ident>
+<.name> ab::cd::x3::42 y non-capturing builtin <.name>
+
+<?wb>def abc\ndef\n-==\nghi y word boundary \W\w
+abc<?wb> abc\ndef\n-==\nghi y word boundary \w\W
+<?wb>abc abc\ndef\n-==\nghi y BOS word boundary
+ghi<?wb> abc\ndef\n-==\nghi y EOS word boundary
+a<?wb> abc\ndef\n-==\nghi n \w\w word boundary
+\-<?wb> abc\ndef\n-==\nghi n \W\W word boundary
+<!wb>def abc\ndef\n-==\nghi n nonword boundary \W\w
+abc<!wb> abc\ndef\n-==\nghi n nonword boundary \w\W
+<!wb>abc abc\ndef\n-==\nghi n BOS nonword boundary
+ghi<!wb> abc\ndef\n-==\nghi n EOS nonword boundary
+a<!wb> abc\ndef\n-==\nghi y \w\w nonword boundary
+\-<!wb> abc\ndef\n-==\nghi y \W\W nonword boundary
+
+<upper> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<upper>: <A @ 45>/ <upper>
+<+upper> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <A @ 45>/ <+upper>
+<+upper>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <ABCDEFGHIJ @ 45>/ <+upper>+
+<lower> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<lower>: <a @ 55>/ <lower>
+<+lower> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <a @ 55>/ <+lower>
+<+lower>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <abcdefghij @ 55>/ <+lower>+
+<alpha> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<alpha>: <_ @ 31>/ <alpha>
+<+alpha> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <_ @ 31>/ <+alpha>
+<+alpha>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <_ @ 31>/ <+alpha>+
+<digit> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<digit>: <0 @ 35>/ <digit>
+<+digit> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0 @ 35>/ <+digit>
+<+digit>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0123456789 @ 35>/ <+digit>+
+<xdigit> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<xdigit>: <0 @ 35>/ <xdigit>
+<+xdigit> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0 @ 35>/ <+xdigit>
+<+xdigit>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0123456789ABCDEF @ 35>/ <+xdigit>+
+<space> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<space>: <\t @ 0>/ <space>
+<+space> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t @ 0>/ <+space>
+<+space>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t\n\r @ 0>/ <+space>+
+<blank> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<blank>: <\t @ 0>/ <blank>
+<+blank> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t @ 0>/ <+blank>
+<+blank>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t @ 0>/ <+blank>+
+<cntrl> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<cntrl>: <\t @ 0>/ <cntrl>
+<+cntrl> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t @ 0>/ <+cntrl>
+<+cntrl>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <\t\n\r @ 0>/ <+cntrl>+
+<punct> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<punct>: <! @ 4>/ <punct>
+<+punct> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <! @ 4>/ <+punct>
+<+punct>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <!"#$%&/ <+punct>+
+<alnum> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob<alnum>: <0 @ 35>/ <alnum>
+<+alnum> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0 @ 35>/ <+alnum>
+<+alnum>+ \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /mob: <0123456789ABCDEFGHIJabcdefghij @ 35>/ <+alnum>+
+<+alnum+[_]> ident_1 y union of character classes
+<+[ab]+[\-]>+ aaa-bbb y enumerated character classes
+<+ [ a b ]+[\-]>+ aaa-bbb y whitespace is ignored within square brackets and after the initial +
+<+[ab]+[\-]>+ -ab- y enumerated character classes variant
+<+[ab]+[\-]>+ ---- y enumerated character classes variant
+<+[ab]+[\-]>+ - y enumerated character classes variant
+<-[ab]+[cd]>+ ccdd y enumerated character classes variant
+^<-[ab]+[cd]>+$ caad n enumerated character classes variant
+<- [ a b ]+[cd]>+ ccdd y whitespace is ignored within square brackets and after the initial -
+^<-upper>dent ident_1 y inverted character class
+^<-upper>dent Ident_1 n inverted character class
+<+alpha-[Jj]>+ abc y character class with no j
+<+ alpha - [ Jj ]> abc y character class with no j with ws
+^<+alpha-[Jj]>+$ aJc n character class with no j fail
+
+## vim: noexpandtab tabstop=4 shiftwidth=4
41 t/perl6regex/rx_syntax
@@ -0,0 +1,41 @@
+## syntax errors
+
+{{ abcdef /Missing closing braces/ unterminated closure
+\1 abcdef /reserved/ back references
+\x[ abcdef /Missing close bracket/ unterminated \x[..]
+\X[ abcdef /Missing close bracket/ unterminated \X[..]
+
+* abc abcdef /Quantifier follows nothing/ bare * at start
+ * abc abcdef /Quantifier follows nothing/ bare * after ws
+[*|a] abcdef /Quantifier follows nothing/ bare * after [
+[ *|a] abcdef /Quantifier follows nothing/ bare * after [+sp
+[a|*] abcdef /Quantifier follows nothing/ bare * after |
+[a| *] abcdef /Quantifier follows nothing/ bare * after |+sp
+
++ abc abcdef /Quantifier follows nothing/ bare + at start
+ + abc abcdef /Quantifier follows nothing/ bare + after ws
+[+|a] abcdef /Quantifier follows nothing/ bare + after [
+[ +|a] abcdef /Quantifier follows nothing/ bare + after [+sp
+[a|+] abcdef /Quantifier follows nothing/ bare + after |
+[a| +] abcdef /Quantifier follows nothing/ bare + after |+sp
+
+? abc abcdef /Quantifier follows nothing/ bare ? at start
+ ? abc abcdef /Quantifier follows nothing/ bare ? after ws
+[?|a] abcdef /Quantifier follows nothing/ bare ? after [
+[ ?|a] abcdef /Quantifier follows nothing/ bare ? after [+sp
+[a|?] abcdef /Quantifier follows nothing/ bare ? after |
+[a| ?] abcdef /Quantifier follows nothing/ bare ? after |+sp
+
+: abc abcdef /Quantifier follows nothing/ bare : at start
+ : abc abcdef /Quantifier follows nothing/ bare : after ws
+[:|a] abcdef /Quantifier follows nothing/ bare : after [
+[ :|a] abcdef /Quantifier follows nothing/ bare : after [+sp
+[a|:] abcdef /Quantifier follows nothing/ bare : after |
+[a| :] abcdef /Quantifier follows nothing/ bare : after |+sp
+
+ abcdef /Null pattern illegal/ null pattern
+ abcdef /Null pattern illegal/ ws null pattern
+
+ =abc abcdef /LHS of alias must be lvalue/ bare : after ws
+[ =a] abcdef /LHS of alias must be lvalue/ bare : after [+sp
+[a| =a] abcdef /LHS of alias must be lvalue/ bare : after |+sp
Please sign in to comment.
Something went wrong with that request. Please try again.