2 Replies Latest reply: Apr 30, 2012 7:10 AM by Tony T1
Tony T1 Level 6 Level 6 (8,730 points)

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?)

 

Tony


MacBook Air, MacBook, Mac mini, Mac OS X (10.7.3)