For the general case, regex matching simply will not do. The regex becomes so hairy so it turns write-only, i.e. unmaintainable. Regex matching is also slower than a handwritten custom parser.
The code that used to be in query_classifier.cc is now in trxboundarymatcher.cc.
In preparation for some modifications that are easier done using C++.