Skip to main content

What is Regex?

Regex lets you define search patterns that match a wide range of text combinations. This is especially helpful when scammers use unpredictable variations of names or keywords.
Want to test your regex? Visit regex101.com
You can paste in your regex pattern and test it against different usernames. It also includes a reference guide.

Basic Example

/name-filters add regex ^Pascal$ This matches only the exact word Pascal.
  • ^ = start of the name
  • Pascal = exact characters
  • $ = end of the name
So it will only match: Pascal
It will not match: Pascal_, SirPascal, or pascal

Case-Insensitive Example

To make a regex case-insensitive, use (?i) at the beginning: /name-filters add regex (?i)^Pascal$ This will match:
  • pascal
  • Pascal
  • PASCAL
  • pAsCaL
But won’t match:
  • Pascall
  • this is pascal
  • 0xPascal
/name-filters add regex (?i) bot$ This filter targets any username ending in a space followed by “bot” — a common impersonation tactic. It will match:
  • OpenSea BOT
  • AB bot
  • Doodles Best Bot
It will not match:
  • bottom
  • best bots
  • bot (without a space in front)
Note: There is an intentional space in the filter: (?i) bot$

Caution & Best Practices

  • Always test your regex on regex101.com before adding it
  • Run /cleanse after adding a new filter to catch matches already in your server
  • If you accidentally create an overly broad filter:
    1. Use /settings pause pause-state:pause to stop Hashbot from acting
    2. Remove the problematic filter
    3. Use /settings pause pause-state:unpause to resume normal operation
    4. Cancel any pending /cleanse jobs if needed

Need Help?

Regex can be tricky. If you’re not confident, join our Support Discord and open a ticket.
We’re happy to help build or review filters with you.