I can't seem to get ungreedy (?) to work in grep.
echo "This is a <EM>first</EM> test" | grep -E -o '<.+?>'
returns <EM>first</EM> (not <EM> </EM>)
(I can use '<[^>]+>', but why isn't '<.+?>' working?)
I do not see in "man grep" (nor "man re_format") where it talks about supporting .+? syntax. Are you confusing a different platform's grep or perhaps perl's regular expressions?
I didn't see it in the man page either, but I thought GNU grep supported ungreedy, but wasn't sure.
....just tried -P, so ungreedy does work in grep with -P, --perl-regexp
Retrieving data ...