fix #462. Add a test for regex with dollar sign