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

need regex help

Thread Next
From:
ToddAndMargo
Date:
August 2, 2018 04:56
Subject:
need regex help
Message ID:
91b32faa-5ce2-d3ea-93fb-a41a91954daa@zoho.com
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";}'
===SORRY!===
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,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About