in reply to Re: How do I match the closest of repeated strings?
in thread How do I match the closest of repeated strings?

I tried that (as it seemed like the obvious thing to do), but it didn't work. I got the match from the first abc up to the def.
  • Comment on Re^2: How do I match the closest of repeated strings?

Replies are listed 'Best First'.
Re^3: How do I match the closest of repeated strings?
by GrandFather (Saint) on Sep 29, 2008 at 20:00 UTC
    'xyz abc 123 abc pqr abc get this bit def ijk abc lmn' =~ /.*abc(.*?)d +ef/sm; print ">$1<";

    Prints:

    > get this bit <

    which is what I understood you to want.

    Update: Ah, I see it did do what you want. ;)


    Perl reduces RSI - it saves typing