The Interledger Community 🌱

Cover image for RegEx to check correct payment pointer address
Radhy
Radhy

Posted on

RegEx to check correct payment pointer address

Does anyone have any golden rule for RegEx to check valid payment pointer? Would be great if it's future proof, as well cover many digital wallets pointer addresses and edge cases like using backend proxy to handle payment pointers.

Thanks.

Top comments (2)

Collapse
 
sid profile image
Sid Vishnoi

Following works for some common cases at least. It's not very strict. Might be ok for HTML input validation.

/^\$(?:(?:\w+\.)+\w{2,})+(?:(?:\w+\/)+\w+)*$/
Enter fullscreen mode Exit fullscreen mode

regex101.com/r/vCrwOa/1

Came across this post looking for answers, but had to create my own. Saved for future reference 😄

Collapse
 
radhyr profile image
Radhy

Looking great. Really appreciate for this Sid! 👍