use Perl6::Rules; use Test::Simple 'no_plan'; rule bc { b?c } ok( "a cdef" =~ m/ c> def/, "Lookbehind" ); ok( "acdef" !~ m/ c> def/, "Lookbehind failure" ); ok( "a cdef" !~ m/ c> def/, "Negative lookbehind failure" ); ok( "acdef" =~ m/ c> def/, "Negative lookbehind" ); ok( "abcd f" =~ m/abc f> (.)/, "Lookahead" ); ok( $1 eq 'd', "Verify lookahead" ); ok( "abcdef" !~ m/abc f>/, "Lookahead failure" ); ok( "abcd f" !~ m/abc f>/, "Negative lookahead failure" ); ok( "abcdef" =~ m/abc f> (.)/, "Negative lookahead" ); ok( $1 eq 'd', "Verify negative lookahead" );