http://www.perlmonks.org?node_id=1062597


in reply to Re^3: Regex problem - (non)greedy?
in thread Regex problem - (non)greedy?

I expect he'd want "" for the first and "" for the second. As for the third, see my update.

Replies are listed 'Best First'.
Re^5: Regex problem - (non)greedy?
by hdb (Monsignor) on Nov 14, 2013 at 14:40 UTC

    The first one does not match as the OP contains two spaces at least between 'cd' and 'ghi'.

    Also what would he expect for 'cd cd ghi'?

      He clearly doesn't want the middle "cd" as that's his question.

        But he says the 'EF' would be a random text, so it could be 'cd' as well?

        And what about 'cd accd ghi'?