pass regexFactory as a global to scripts