[util] Implement isRegExp() method