Because the URL may contain characters such as %2e, which should be unescape()ed back into their original unencoded forms (. in this case).
For what definition of "works"?
Originally Posted by Agrajag
Yes, if the regular expression is always matched (if the sought parameter is always present), then the exec method will always return an object reference. However, if a parameter is absent the return value will be null, and attempting to access a property of a null value will cause a run-time error.