Base32 Encoded String Regular Expression

A regular expression that matches a valid Base32 encoded string.

/(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}={6}|[A-Z2-7]{4}={4}|[A-Z2-7]{5}={3}|[A-Z2-7]{7}=)?/

What Is Base62:

Base32 is the base-32 numeral system. It uses a set of 32 digits, each of which can be represented by 5 bits. One way to represent Base32 numbers in a human-readable way is by using a standard 32-character set, such as the twenty-two upper-case letters A–V and the digits 0-9.

Matches:

  • IJQXGZJTGIQG63TMNFXGKIDFNZRW6ZDFEBTHK3TDORUW63Q=

See Also: