From 8ec36494fb28d92d8bb5c4b3fc213a1a2b6d0bb6 Mon Sep 17 00:00:00 2001 From: jory-graham Date: Thu, 5 Aug 2021 13:58:39 -0400 Subject: Replace A-Za-z with [:alpha:] --- lib/psych/scalar_scanner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index 5fafaf3..b66ff99 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -33,7 +33,7 @@ module Psych # Check for a String type, being careful not to get caught by hash keys, hex values, and # special floats (e.g., -.inf). - if string.match?(/^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/) || string.match?(/\n/) + if string.match?(%r{^[^\d.:-]?[[:alpha:]_\s!@#$%\^&*(){}<>|/\\~;=]+}) || string.match?(/\n/) return string if string.length > 5 if string.match?(/^[^ytonf~]/i) -- cgit v1.2.1