Compare regexp as string.

Fix #1633.
Merge pull request #1636 from braddunbar/regexp-isequal

Compare regexp as string.