Suppose I want to combine words with at least four letters (and store them in an array), I wrote the following regular expression that works fine:
if ( $text ~~ m:g/(\w ** 4..*)/ ) { my @words = $/; ... }
Quantifier from 4 to unlimited
**4..*
Now, if I try to replace 4 with scalar $ min_length. Both:
if ($text ~~ m:g/(\w ** $::min_length..*)/)
and
if ($text ~~ m:g/(\w ** <$::min_length>..*)/)
results in a compilation error: Quantifier does not count anything
Is there a way to get a scalar as a quantifier?
regex perl6
Mikkel
source share