The + essentially indicates that this is a character-class match.  It's to 
distinguish things from <.alpha>, <?alpha>, <!alpha>, <-alpha>, and <alpha> 
(among others).

Pm

On Fri, Aug 03, 2018 at 08:48:24PM +0200, Timo Paulssen wrote:
> The + is required, perhaps because the first character after the opening
> < is supposed to determine exactly what thing it is? Not sure about
> that. The + and - is a bit like "start at nothing, add all alnums, then
> subtract all alphas". The + after the < > is just to match it any number
> of times, but at least once, and the $ at the end, together with the ^
> at the start, ensures that every character in the string has to match,
> not just any character.
> 
> Hope that makes sense
>   - Timo
> 
> 
> On 03/08/18 20:04, ToddAndMargo wrote:
> > On 08/02/2018 05:18 AM, Timo Paulssen wrote:
> >> Is this what you want?
> >>
> >> perl6 -e 'say "12345" ~~ /^<+alnum -alpha>+$/'
> >> 「12345」
> >>
> >> perl6 -e 'say "123a45" ~~ /^<+alnum -alpha>+$/'
> >> Nil
> >>
> >> HTH
> >>    - Timo
> >>
> >
> > What does the following do?
> >
> >      +alnum   (why does it need the "+"?)
> >      -alpha   (I presume "-" means negate?)
> >      +$
> >
> > Many thanks,
> > -T

Reply via email to