Sunday, 15 February 2015

linux - how to egrep after using egrep -o -



linux - how to egrep after using egrep -o -

i have file called random.html next line(not line):

blahblahblahblah random="whatever h45" blahblahblahblah

i want whatever, far used following:

egrep -o 'random="([a-z]*[a-z]*[0-9]*[ ]*)+'

this gives me random="whatever h45

i cant utilize egrep -o ="([a-z]*[a-z]*[0-9]*[ ]*)+' begin because not line , there unwanted lines, random keyword of import distinction purposes. tried double egrep -o such as:

egrep -o 'random="([a-z]*[a-z]*[0-9]*[ ]*)+' | egrep -o '="([a-z]*[a-z]*[0-9]*[ ]*)+'

where display ="whatever h45 doesn't work. doing wrong or illegal? don't want utilize fancy or utilize cut. supposed "basic".

this impossible grep; see question (and accepted answer): capturing groups grep regex

linux bash shell grep

No comments:

Post a Comment