Re: Help me be greedy!

2017-08-04 Thread ToddAndMargo
On 08/04/2017 03:24 PM, Brent Laabs wrote: PCRE has the /U flag that reverses the behavior of .* and .*? (/PCRE_UNGREEDY)/ Greed ultimately wasn't the issue. I screwed up a bunch of other things.

Re: Help me be greedy!

2017-08-04 Thread Brent Laabs
PCRE has the /U flag that reverses the behavior of .* and .*? ( *PCRE_UNGREEDY)* This was always a terrible idea, and is probably the source of your confusion. On Fri, Aug 4, 2017 at 12:38 PM, Brandon Allbery wrote: > Like I said, greedy is the default, *.? says *don't* be greedy. You wanted >

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
Like I said, greedy is the default, *.? says *don't* be greedy. You wanted .* for greedy match. But even with that, the extra .* before the f was telling it to eat stuff (greedily, since no ?, so it out-greed-ed the captured non-greedy .*?). On Friday, August 4, 2017, ToddAndMargo wrote: > On Fr

Re: Help me be greedy!

2017-08-04 Thread ToddAndMargo
On Friday, August 4, 2017, ToddAndMargo > wrote: Hi All, I NEED TO BE GREEDY! HAHA HAHA . 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>";'

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
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 wrote: > Hi All, > > I NEED TO BE GREEDY! HAHA HAHA . > > Okay, I am back in contro