cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

Bitcoin RegEx

joelbland
Level 1
Level 1

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

Who Me Too'd this topic