factor out glob2re