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
Post a Comment