const createRegex = (pattern: string): RegExp => new RegExp(`(?