On 08/01/2018 10:00 PM, Brandon Allbery wrote:
Set operations have to be inside the <>. You want something like:
/<[alnum-alpha]>/.
That said, this would be the same as /<digit>/, I think? Please describe
in words what you intended with that regex. (I suspect /<[alpha]>/ is
what you really want, based on your earlier statement.)
Poop!
p6 'my $x="9.01"; if not $x~~/<[alpha-alnum]>/ {say "Y";}else{say "N";}'
===SORRY!=== Error while compiling -e
Unsupported use of - as character range; in Perl 6 please use .. for
range, for explicit - in character class, escape it or place it as the
first or last thing
at -e:1
------> my $x="9.01"; if not $x~~/<[alpha-⏏alnum]>/ {say "Y";}else{say "N";}
This is my workaround:
$ p6 'my $x="9.b01"; if not $x~~/<alpha>/ && $x~~/<alnum>/ {say
"Y";}else{say "N";}'
N
$ p6 'my $x="9.01"; if not $x~~/<alpha>/ && $x~~/<alnum>/ {say
"Y";}else{say "N";}'
Y
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~