Updated the regex to make it work when putting the hash after '?'