mirror of
https://github.com/wader/fq.git
synced 2024-12-23 05:13:30 +03:00
snippets: urlencode: only 0-9a-f
This commit is contained in:
parent
a5b802b288
commit
fda1dda1ae
@ -14,10 +14,11 @@ def flac_dump:
|
||||
|
||||
def urldecode:
|
||||
gsub(
|
||||
"%(?<c>..)";
|
||||
"%(?<c>[a-fA-F0-9]{2})";
|
||||
( .c
|
||||
| ascii_downcase
|
||||
| explode
|
||||
# "0"-"9" or "a"-"f"
|
||||
| map(.-48 | if .>=49 then .-39 else . end)
|
||||
| [.[0]*16+.[1]]
|
||||
| implode
|
||||
|
Loading…
Reference in New Issue
Block a user