You do realize that RFC 3986 actually contains an official regular expression, right? http://tools.ietf.org/html/rfc3986#appendix-B
"%x"
(edit: actually, feel free to do it with the quotes included if you like, that would still be matched by that regex)