Compare regexp as string.

Fix #1633.