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 (select the Java flavor) for testing and its reference guide — it uses the same matching engine as Hashbot.
Basic Example
/name-filters add regex ^Pascal$
This matches only the exact word Pascal.
^= start of the namePascal= exact characters$= end of the name
PascalIt 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:
pascalPascalPASCALpAsCaL
Pascallthis is pascal0xPascal
Recommended Filter Example
/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 BOTAB botDoodles Best Bot
bottombest botsbot(without a space in front)
Note: There is an intentional space in the filter:
(?i) bot$Quick Reference
Common Filter Patterns
Limitations
Hashbot uses Java’s regex engine. Most standard regex features are supported, including:- Inline flags like
(?i)for case-insensitive mode - Lookahead/lookbehind —
(?=...),(?!...),(?<=...),(?<!...) - Character classes, quantifiers, alternation, and anchors
Hashbot rejects a few dangerous patterns at creation time:
- Nested quantifiers like
(a+)+— these can cause catastrophic backtracking - Empty alternation branches — in regex,
|means OR, so a pattern like(?i) | YourBrand$contains a whitespace-only branch that would match nearly every member. To match a literal pipe (the common DiscordName | Orgconvention), escape it:\| YourBrand$ - Patterns longer than 500 characters (50 on the free tier), and filters that would match an empty name or a lone space
Caution & Best Practices
- Always test your regex on regex101.com before adding it (select the Java flavor for best accuracy)
- Run
/cleanseafter adding a new filter — results are displayed with a “Review on Dashboard” button at dashboard.hashbot.com - Avoid overly broad patterns like
.+or.*— they match nearly everything - If you accidentally create an overly broad filter:
- Use
/settings pause pause-state:pauseto stop Hashbot from acting - Remove the problematic filter
- Use
/settings pause pause-state:unpauseto resume normal operation - Cancel any pending
/cleansejobs if needed
- Use
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.