(#16668) 1.8.7 support - fix regex

This fixes a small issue with running in ruby 1.8.7 where
the regex needed explicit escapes that were not previously
specified.