Regex-Fu

Chris via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 25 04:28:38 PDT 2015


On Monday, 25 May 2015 at 11:20:46 UTC, novice2 wrote:
>> I cannot get the longest possible
> it match longest for first group ([a-z]+)
>
> try
>
> ^([a-z]+?)(hula|ula)$

Namespace, novice2:

Ah, I see. The problem was with the first group that was too 
greedy, not with the second. I was focusing on the latter. 
Thanks, this works now!


More information about the Digitalmars-d-learn mailing list