RegEx to match Bitcoin addresses?

前端 未结 8 2258
深忆病人
深忆病人 2020-12-14 06:44

I am trying to come up with a regular expression to match Bitcoin addresses according to these specs:

A Bitcoin address, or simply address, is an iden

8条回答
  •  猫巷女王i
    2020-12-14 07:24

    ^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$
    

    will match a string that starts with either 1 or 3 and, after that, 25 to 34 characters of either a-z, A-Z, or 0-9, excluding l, I, O and 0 (not valid characters in a Bitcoin address).

提交回复
热议问题