I understand that
'*' : The preceding item will be matched zero or more times.
'?' : The preceding item is optional and will be matched, at most, once.
'+' : The preceding item will be matched one or more items
Can anyone give me an example of when there would be a difference while using grep? I was using egrep, but I tried to check if I could generate different outputs for these operators.
?and+are part of extended regex, so you do need egrep for that to work – Sergiy Kolodyazhnyy Sep 09 '16 at 08:50grep -Ein GNU grep :) – Zanna Sep 09 '16 at 08:54?matches a literal?while\?is the{0,1}quantifier; whereas in ERE it's the other way around i.e.?is the quantifier while\?matches a literal?– steeldriver Sep 09 '16 at 11:41