Build a combined regex pattern from a list of terms
This creates a single pattern that matches any of the terms using case-insensitive matching
without word boundaries for more flexible matching
Create a QueryPlan from a raw query string. This fully parses the query into an AST,
then extracts all terms (including excluded), and prepares a term-index map.
Generate regex patterns that respect the AST’s logical structure.
This creates a single combined pattern for all terms, regardless of whether they’re
required, optional, or negative.