What is the best, most correct way of regex'ing the address and payment ID for Monero?
Asked
Active
Viewed 2,686 times
5
-
To avoid duplication can you edit this question to better emphasize how it is different? Perhaps focus on the payment ID part (or an integrated address) which was not discussed in the previous question. – Smart Kid Nov 03 '16 at 00:50
1 Answers
9
A Monero address:
4[0-9AB][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{93}
A payment ID:
([0-9a-fA-F]{16}|[0-9a-fA-F]{64})

Jonathan Cross
- 623
- 5
- 19

Asdax
- 551
- 4
- 12
-
-
1
-
1The
|
was actually an error (worse than useless) because it would match a literal pipe character. Now fixed. – Jonathan Cross Sep 20 '17 at 12:01 -
Address could be reduced:
^4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}$
– Jefrey Sobreira Santos Feb 24 '18 at 19:14 -