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

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -