Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created August 20, 2010 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/540747 to your computer and use it in GitHub Desktop.
Save anonymous/540747 to your computer and use it in GitHub Desktop.
pmichaud@plum:~/nqp-rx$ cat y.nqp
#! nqp
for < Bool::True True True::X Bool::True::X > {
my $match := $_ ~~ / 'Bool::'?: 'True' && <[A..Za..z:\-]>+: /;
say( $match ?? "$_ matches" !! "$_ doesn't match");
}
pmichaud@plum:~/nqp-rx$ ./nqp y.nqp
Bool::True matches
True matches
True::X doesn't match
Bool::True::X doesn't match
pmichaud@plum:~/nqp-rx$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment