patched a bug in the way the regex is returned