Fix a problem where custom quote regex won't work because the quote doesn't has '>'

also simplified a condition statement.