Groups
AhoโCorasick (AC) turns a set of forbidden patterns into a finite automaton that lets you process or generate strings while tracking whether any pattern appears.
A Palindromic Tree (Eertree) stores every distinct palindromic substring of a string as a node and can be built online in linear time.