regex is not a function