Regexes literals in ruby don't require escaping for slashes.
Instead of:
/http:\/\/sub\.domain\.com\/path/
You can use this:
%r{http://sub\.domain\.com/path}