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

also simplified a condition statement.