8

greedy and lazy regular expressions (comprehension question)

view full story
linux-howto

http://unix.stackexchange.com – I am teaching myself regular expressions, and I got stuck at »greedy« vs. »lazy« repeatings. What I found out so far is that »greedy« means that the RegExp looks for as many matches as possible, where »lazy« means that the RegExp looks for as little matches as possible Most articles I found deal with a) using it in a programming language, while I am stuck here with grep and egrep or b) use grep -P to activate Perl Mode; but as I don't have any knowledge about Perl yet this isn't very helpful for me. My comprehension question: I came to thi (HowTos)