Correct regex function to properly obtain URL parameters

The previous changes to the regex function where incorrect. Now, the
function correctly obtains the URL paramter when it exists and, returns
null when it doesn't exist.