(?<!\\)_
will find occurrences of _ that are not preceded by \. Replace those with \_.
Personally, no. But it looks as though this might help.
http://sitescooper.org/tao_regexps.html
Roger