regex - Regular expression not showing multiple line content -


i have file following format.

<hello> <random1> <random2> .... .... .... <random100> <bye> 

i want find whether bye , hello there, , bye below hello. tried regular expression.

grep "hello.*bye" filename

but fails match expected.

you use pcregrep:

pcregrep -m 'hello(\n|.)*bye' filename 

the -m option makes possible search patterns span line boundaries.

for input, it'd produce:

<hello> <random1> <random2> .... .... .... <random100> <bye> 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -