5

What is the best, most correct way of regex'ing the address and payment ID for Monero?

marked as duplicate by Papa Lazzarou, seek adventure, janowitz, Smart Kid Nov 3 '16 at 0:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 3 '16 at 0:50
9

A Monero address:

4[0-9AB][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{93}

A payment ID:

([0-9a-fA-F]{16}|[0-9a-fA-F]{64})
  • [0-9a-fA-F]{64} – user36303 Nov 1 '16 at 17:36
  • 1
    I believe | is useless in the first regexp – Kukunin Sep 2 '17 at 8:25
  • 1
    The | 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.