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|\\-|_]
You don't need to use | symbol in a regex character class to separate the characters. Perhaps try something like this ...
|
[a-zA-Z0-9\-_]