There appears ot be a bug in the sed function that requires the use of two backslashes '\\' to escape characters in the regexp of a command line substitution. The single backslash is simply ignored entirely as far as I can tell. The replacement string does not have this problem, it seems to work normally. Here is an example:
sed "s!\.properties!\.config!" file.txt
This will should only locate the literal string '.properties' but it is not escaping the '.' and therefore replacing any instance of the sting "properties" and it's preceding character as it treats the '.' as a wild-card.
so....
file.properties --> file.config (good)
#my properties file --> #myconfig file (bad)
The solution (work-around) is to use a double-backslash. For whatever reason this seems to react as if there is only one. The obvious problem here being that you have to convert any scripts that use sed to cigwyn, an annoyance to anyone using UNIX and cygwin in a development environment.