glob2regex is not 100% accurate yet, but it works at least for the cases in the accompanying unit test.
It's still missing ast optimization and some code cleanup is also needed, but it should be working in the general case. Also write a small unit test for it.