I\'m having trouble getting sed to recognize both hyphen and underscore in its pattern string.
Does anyone know why
[a-z|A-Z|0-9|\\-|_]
In my case, I wanted to replace a config setting that included a hyphen. Surrounding the setting in .* worked:
.*
sed 's/.*some-service.*/some-service="new-value"/g' file
Also works when the config setting has an underscore.