[FIX] duck type checking for regex objects