The page shows a table of what does not need to be encoded, so include those in the regex's character class:

Code:
alias urlencode { return $regsubex($$1-,/([^-.~\w])/g,$+(%,$base($asc(\t),10,16))) }


\w handles 0-9A-Za-z_ so just -.~ needed to be added.