develooper Front page | perl.perl6.users | Postings from August 2018

need regex help

Thread Next
August 2, 2018 04:56
need regex help
Message ID:
Hi All,

If there are any letter in the string, I want it to fail

$ p6 'my $x="9.0v1"; if $x~~/<+alnum>-[<alpha>]>/ {say "Y";}'
Unrecognized regex metacharacter - (must be quoted to match literally)
at -e:1
------> my $x="9.0v1"; if $x~~/<+alnum>⏏-[<alpha>]>/ {say "Y";}
Unable to parse regex; couldn't find final '/'
at -e:1
------> my $x="9.0v1"; if $x~~/<+alnum>-⏏[<alpha>]>/ {say "Y";}

What am I doing wrong?

Many thanks,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About