Add support for regular expressions as environment URL patterns; fix script errors on IE8