Hashbot User Guide
WebsiteDiscordSubscribeFAQ
  • User Guide
  • Getting Started
    • Invite Hashbot
    • Hashbot Permissions
    • Hashbot Role & Other Bots
    • Log Channel
    • ⭐Activate Subscription
    • Manager Role(s)
    • Allowlisted Role(s) & User(s)
    • ⭐Fuzzy Mode
    • ⭐Templates (Text and PFP)
  • Blocklist Management
    • Name-Filters
      • Add & Remove Filter
      • Phrase & Regex
        • Phrase
        • Regex
      • Test Filters
    • Cleanse
    • ⭐PFP
      • PFP Setup
      • PFP Removal
      • PFP Template
      • PFP Review
  • Premium Subscription
    • ⭐Premium Plans
    • ⭐Premium Perks
    • ⭐Premium Commands
  • Full Command Reference
    • Complete Command List
    • Frequently Asked Questions
  • Hashbot Safety Suite
    • Meet our Bots
    • ❌DM Disabler
    • 🐊MemberGator
Powered by GitBook
On this page

Was this helpful?

  1. Blocklist Management
  2. Name-Filters
  3. Phrase & Regex

Regex

PreviousPhraseNextTest Filters

Last updated 1 year ago

Was this helpful?

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: 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 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.

https://regex101.com/
join our Discord