I have a file called random.html with the following line(not the only line):
blahblahblahblah random="whatever h45" blahblahblahblah
I want to specifically only get whatever, so far i used the following:
egrep -o 'random="([a-z]*[A-Z]*[0-9]*[ ]*)+'
This gives me random="whatever h45
I cant use just egrep -o ="([a-z]*[A-Z]*[0-9]*[ ]*)+'
to begin with because this is not my only line and there will be unwanted lines, the random keyword is important for distinction purposes. I tried to do a double egrep -o such as:
egrep -o 'random="([a-z]*[A-Z]*[0-9]*[ ]*)+' | egrep -o '="([a-z]*[A-Z]*[0-9]*[ ]*)+'
Where it would just display ="whatever h45
but that doesn't work. Am i doing something wrong or is this illegal? I don't want to use anything fancy or use cut. This is supposed to be very "basic".