I know sed is greedy when matching patterns. But, how greedy is it?
Consider these examples.
$ echo 'foobar123' | sed 's/[0-9]*/(&)/'
()foobar123
$ echo 'foobar123' | sed 's/[0-9][0-9]*/(&)/'
foobar(123)
Why doesn't the second example print foobar(1)23
and instead prints foobar(123)
?