Escape } in context regexes for ruby 1.8.7.

Ruby 1.8.7 throws:
warning: regexp has `}' without escape

I'm not sure if it's worth fixing this or not, but we're stuck with 1.8.7 on a few servers for hopefully not too much longer.