summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjory-graham <jory.graham@shopify.com>2021-08-05 13:58:39 -0400
committerjory-graham <jory.graham@shopify.com>2021-08-05 13:58:39 -0400
commit8ec36494fb28d92d8bb5c4b3fc213a1a2b6d0bb6 (patch)
tree6ea7699474325d10840f3a8f33117347d2898b8d /lib
parent02f759dd74cbd3787263c5a32b7505fc8ddf76cc (diff)
downloadpsych-8ec36494fb28d92d8bb5c4b3fc213a1a2b6d0bb6.tar.gz
Replace A-Za-z with [:alpha:]
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/scalar_scanner.rb2
1 files changed, 1 insertions, 1 deletions
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)