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

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -