cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
586
Views
0
Helpful
1
Replies
Highlighted
Beginner

Bitcoin RegEx

Hi all,

 

Our team has been working on a regular expression for detecting bitcoin addresses. I'd like to get your feedback on our RegEx and see what others are doing to detect crypto currency addresses in email. 

 

The RegEx we're using in our Dictionary is:

(\s|^|\:)[1|3][a-km-zA-HJ-NP-Z0-9]{26,34}(\s|$|\.)

Our regex includes some additions besides the standard bitcoin regex. The additions address some specific samples we saw in our environment, such as a colon before the address or a period following the address.

 

 

Please let me know if you have any improvements to the RegEx or other strategies for detecting bitcoin addresses.

 

Thanks!

 

P.S. - It would be ideal if the ESA could perform the address validation via a Smart Identifier.

 

"...in the spec itself they suggest to avoid using a RegEx or a length and content check to validate a Bitcoin address string, and points to this thread, where they show a validator that “does a “deep” validation, checking that the checksum built into every bitcoin address matches the address.”

http://mokagio.github.io/tech-journal/2014/11/21/regex-bitcoin.html

Everyone's tags (4)
1 REPLY 1
Collaborator

Re: Bitcoin RegEx

I have asked for this as a smart identifier during the last beta I participated in...