The current pattern matching is simplified using `Regex`, which will be replaced with a scratch pattern matching implementation. This will reduce the overhead of conversion to Regex and is expected to provide higher performance.