develooper Front page | perl.perl6.language | Postings from April 2006

S5 - Question about repetition qualifier

Thread Next
From:
Joe Gottman
Date:
April 25, 2006 18:57
Subject:
S5 - Question about repetition qualifier
Message ID:
000001c668d4$d8632710$3a024447@JoeGottman1
According to Synopsis 5, the repetition qualifier is now **{.} where the .
must correspond to either an Int or a Range.  This seems rather restrictive.
Why are we not allowed a junction of Ints, for instance 

            m/^ a**{1|3|5} $/ ; # Match 1,3, or 5 a's.

 

This does not seem noticeably more difficult than a range.  

Also, I don't know exactly what the syntax looks like, but I can imagine
using a repetition qualifier that takes a closure of some sort, for instance
to match an odd number of repetitions

 

m/^ a**{($_ % 2 == 0)} $/; #I'm not sure about the syntax for the code.

 

Joe Gottman



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