Hello guys,
Do you think it’s possible to censor crypto address in topics? Not even sure a regex can do that… am I right?
Thanks.
Hello guys,
Do you think it’s possible to censor crypto address in topics? Not even sure a regex can do that… am I right?
Thanks.
What’s a crypto address?
What do you mean by “censor” - hide? block? force review/approval?
Ok, this is a example of a crypto address : 0x6dD9EF7464A3c28f1285bCCB95bE83dC4A9De3ca
Not easy to detect by a regex imho. What I would like is that if a member tries to publish an address of this type it is obfuscated in the public message. And possibly visible for moderation but this is not necessarily the most important.
Very easy to detect by a regex since it’s always 0x and then 40 characters a-f and numbers.
/^0x[a-fA-F0-9]{40}$/g
BTC addresses would be ^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$ (13 followed by 25 to 34 characters, excluding l, I, O and 0)
Add this to watched words and don’t forget to enable settings - posting - “watched words regular expressions”.
Depending on which regexp engine you’re using it can be written as
/^0x\h{40}$/
![]()
Thanks both.
If I’m not mistaken, there are as many sequences of addresses as crypto tokens. The example I provided is for the LINK token, but for ETH, BTC, XRP… and hundreds of others how to do it?
But in general it is easy to recognise a crypto address visually, this long sequence of characters is rather typical, so I was wondering if AI could not solve this problem more widely.
It seems feasible to you in Discourse (a plugin maybe?)
I don’t think this is so complicated that we would need AI to solve it.
What they all have in common is that they’re a pretty long string of characters without any spaces, so ^[a-zA-Z0-9]{25,60}$ would get you pretty far.