On 05/10/2018 09:13 PM, ToddAndMargo wrote:
On Thu, May 10, 2018 at 11:56 PM, ToddAndMargo <toddandma...@zoho.com
<mailto:toddandma...@zoho.com>> wrote:
Hi All,
I am trying to convert this over from Perl5:
P5:
$dir_entry =~ /.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*${Extension}/;
P6:
$dir_entry ~~ m/.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*{$Extension}/;
$ perl6 -c GetUpdates.pl6
===SORRY!===
Unsupported use of {N,M} as general quantifier; in Perl 6 please use
** N..M (or ** N..*)
at /home/linuxutil/GetUpdates.pl6:425
------> $dir_entry ~~
m/.*?(\d{1,4}⏏\D\d{1,4}\D\d{1,4}).*{$Extension}/;
What am I doing wrong?
Many thanks,
-T
On 05/10/2018 09:11 PM, Brandon Allbery wrote:
Pretty much what it's telling you. Instead of the numbers in braces,
it's the ** operator with a range after it: \d ** 1..4
(Remember that spaces do nothing in a P6 regex, so you can use them
for readability or to separate the range from what follows, etc.)
The light bulb is not firing. How do I change {1.4}
over to p6?
Light bulb finally went off:
$dir_entry ~~ m/.*?(\d**1..4 \D \d**1..4 \D \d**1..4).*{$Extension}/;
Took a bit
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~