BetterTTV's Highlight Keywords and Blacklist Keywords support full regular expressions, in addition to plain words and phrases. This lets you match flexible patterns instead of a single fixed word.
Wrap your pattern in ~/ and /, with optional flags after the closing slash:
~/pattern/flags
This is the same style as a JavaScript regular expression literal.
| Entry | Matches |
|---|---|
~/(cat|dog)s?/i |
cat, Cat, dogs, DOGS, ... |
~/\bgg\b/i |
the standalone word "gg" (not "eggs") |
~/!(give|raffle)/i |
!give or !raffle commands |
~/[A-Z]{5,}/ |
shouting (5+ uppercase letters in a row) |
Standard JavaScript regex flags work, for example:
i— case-insensitiveg— globalu— unicode
Regex applies to every Target type in the keyword tables:
- Message — tested against the message text
- Username — tested against the sender's name
- Badge — tested against the user's badges
Both the Highlight Keywords and Blacklist Keywords tables support it.
- Patterns are validated for safety. Expressions that could cause catastrophic backtracking are ignored, so a "bad" pattern simply won't match anything rather than freezing your chat.
- If a pattern isn't wrapped in
~/ /, it is treated as a normal word/phrase match (with BetterTTV's usual wildcard and exact-match rules). - Remember to escape regex special characters when you want them matched literally.