added an isRegExp test
(cherry picked from commit 06c74e76f085adf61a8a3690d3e84c8967c4d201)