Regex

Regex: A more complex way of defining patterns. In short, Regex is more granular, but takes more time to set up.

A great website to test a regex: https://regex101.com/ Here, you can enter a pattern and then enter a different username to see if that would be detected or not. There is a reference to the right of the screen for more explanation.

Example: /name-filters add regex ^Pascal$ The only match would be Pascal. This syntax means it's case sensitive, and there is nothing before (noted by the ^) or after (noted by the $) Pascal. If you want it to be case-insensitive, you could add (?i).

Example: /name-filters add regex (?i)^Pascal$

Would be a match: pascal, Pascal, pAsCaL

Would NOT be a match: this is pascal, Pascall, 0xPascal

A filter we recommend: /name-filters add regex (?i) bot$

This regex will remove all usernames ending with a space followed by the word bot.

Would be a match: OpenSea BOT, AB bot, Doodles Best Bot

Would NOT be a match: bottom, best bots, bot (without space in front) [notice the filter has a space after the (?i) ]

The examples provided are simples ones; if you need assistance setting up additional regex filters, please join our Discord and open a ticket.

Make sure to test your regex filters before adding them to your Blocklist. You'll also want to run /cleanse to ensure that you haven't made a mistake and triggered a large number of false positives. If you find that you've created an erroneous filter, cancel any pending /cleanse commands, use /pause to stop Hashbot from applying the new filter, remove the erroneous filter, and then use /pause again to restart Hashbot.

Last updated