On 06/11/2017 03:57 PM, Brandon Allbery wrote:
6 'my $x = "c"; if $x !~~ /<-[A..Z a..z 0..9]>/ {say "out"} else {say "in"}'
Hi Brandon,
Thank you! All typos today. And I now understand
the <[]> syntax.
-T
I wrote this up for my keepers file:
Perl6: checking for the presence of a character(s) inside a string:
$ perl6 -e 'my $x = "\t"; if $x ~~ /<-[A..Z a..z 0..9]>/ {say "out of
match"} else {say "inside of match"}'
out of match
$ perl6 -e 'my $x = "Q"; if $x ~~ /<-[A..Z a..z 0..9]>/ {say "out of
match"} else {say "inside of match"}'
inside of match
$ perl6 -e 'my $x = "\t"; if $x !~~ /<[A..Z a..z 0..9]>/ {say "out of
match"} else {say "inside of match"}'
out of match
$ perl6 -e 'my $x = "Q"; if $x !~~ /<[A..Z a..z 0..9]>/ {say "out of
match"} else {say "inside of match"}'
inside of match