The ? is the opposite of greedy, just as in pcre/perl 5. Greedy is the
default. I also don't see why you have a .* before f if you want to capture
everything before the f.

On Friday, August 4, 2017, ToddAndMargo <toddandma...@zoho.com> wrote:

> Hi All,
>
> I NEED TO BE GREEDY!  HAHA HAHA <miniacle laughter continues>.
>
> Okay, I am back in control of myself (for the moment).
>
> What am I doing wrong here?
>
> perl6 -e 'my $x="a b c d e f"; $x ~~ m/.*?(c.*?).*f/; say "<$0>";'
> <c>
>
> I am after
> <c d e >
>
> I want the space at the end too
>


-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Reply via email to