bash - Unix - Delete a portion which matches a regex -


i have log file , trying tidy use data inside. want use sed 's/foo//g' except instead of matching word foo want delete foo until next space.

i tried (without success):

sed -e -- 's/(?<=foo)(.*)(?= )//g'

any ideas?

i want delete foo until next space.

you can use:

sed 's/foo[^[:blank:]]*//g' file 

[^[:blank:]] match character not space , not tab.


Comments

Popular posts from this blog

PHP and MySQL WP -

javascript - generate date range base on integers -

javascript - Generate barcode from text and convert it to base64 -