zoekt: call optimizeregexp in query builder
Created by: keegancsmith
Zoekt exports a functions we can use to optimize regexes. Right now all clients are required to call this, since we can directly pass in regexes in the zoekt query layer. As we find other potential global optimizations that can be done to a regex, they will be added to this function.
Test Plan: unit tests. The function has already been tested.