Questions
How about using grep -E?
grep -E
echo "This is 02G05 a test string 20-Jul-2012" | grep -Eo '[0-9]+G[0-9]+'
~ Answered on 2012-07-19 20:42:43