diff options
author | jory-graham <jory.graham@shopify.com> | 2021-08-05 13:58:39 -0400 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 19:34:54 +0900 |
commit | db154b20cceb2fc71390cce21fdff23f6f36f7b6 (patch) | |
tree | 21302069f4192b0d8703610b2251f963760c0b45 /ext/psych/lib/psych/scalar_scanner.rb | |
parent | 9ed2cb26dee8ed801a75cf4b276f1ec354ade032 (diff) |
[ruby/psych] Replace A-Za-z with [:alpha:]
https://github.com/ruby/psych/commit/8ec36494fb
Diffstat (limited to 'ext/psych/lib/psych/scalar_scanner.rb')
-rw-r--r-- | ext/psych/lib/psych/scalar_scanner.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index 5fafaf30b3..b66ff9938c 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/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) |