in reply to Re^3: Non-greedy substitution
in thread Non-greedy substitution

Is this clearer now? :)

Totally clear now - thanks Rolf for your explanation :)

Replies are listed 'Best First'.
Re^5: Non-greedy substitution
by LanX (Saint) on Nov 22, 2024 at 15:31 UTC
    Since this is a recurring question, what helped the most? :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      Since this is a recurring question, what helped the most? :)

      This bit was the lightbulb 💡

      the regex-engine tries to find a solution step by step:

      • first it tries the first pattern, here "," = comma
      • then it matches "." = all as many times like quantified ( "*" or "*?" )