grep
doesn't allow printing capture groups. Use sed
:
sed -E 's/abc-([0-9]+)-zzz-([0-9]+).*/\1\2/' file
111022
222033
333044
Alternatively, if you have pcregrep
then use this command to print first 2 capture groups:
pcregrep -o1 -o2 'abc-([0-9]+)-zzz-([0-9]+)' file
111022
222033
333044