Hello! I was wondering if, with egrep ((GNU grep) 2.5.1), I can select a part of the matched text, something like:
grep '^([a-zA-Z.-]+)[0-9]+' ./file.txt
So I get only the part which matched, between the brackets, something like
house.com
Instead of the whole line like I usually get:
house.com112
Assuming I have a line with house.com112 in my file.txt.
(Actually this regular expression is just an example I just want to know if I can print only a part of the whole line.)
I do know in some languages, such as PHP, Perl or even AWK I can, but I do not know if I can with egrep.
Thank you in advance!