Regexp.new(Regexp.quote('http://www.microsoft.com/'))
Regexp.quote
simply escapes any characters that have special regexp meaning; it takes and returns a string. Note that .
is also special. After quoting, you can append to the regexp as needed before passing to the constructor. A simple example:
Regexp.new(Regexp.quote('http://www.microsoft.com/') + '(.*)')
This adds a capturing group for the rest of the path.