On 15/05/18 14:03, ToddAndMargo wrote: > On 05/15/2018 04:49 AM, ToddAndMargo wrote: >> Hi All, >> >> This should be a "no". What am I doing wrong? >> >> $ perl6 -e 'my $x="rd"; if $x~~/<[rc]+[a]+[b]+[.]>/ {say >> "yes"}else{say "no"}' >> yes >> >> >> Many thanks, >> -T > > And how do I turn this into a yes. I am look for > any instance of d through z > > $ perl6 -e 'my $x="f"; if $x~~/<[d.z]>/ {say "yes"}else{say "no"}' > no
The syntax you're looking for is <[d..z]> rather than <[d.z]>. <[d.z]> is a character class that will match a d, a "." or a z, where as <[d..z]> is a character class that matches anything in the range of d to z.