summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 19:48:03 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 19:48:03 +0000
commit725d6f4970423c6a28d1b0e1864c3651528d5670 (patch)
treeb433fef0a275ff2eed3ae2639bfef59ce2e23f0e /ext/psych/lib
parent4760b9824fc4e6ce195249e7b1101bce714b12bd (diff)
* ext/psych/lib/psych/scalar_scanner.rb: fix regexp for matching TIME
strings. * test/psych/test_date_time.rb: test for change. Fixes: https://github.com/tenderlove/psych/issues/171 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
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 068fc0e3cf..5a805981b1 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -5,7 +5,7 @@ module Psych
# Scan scalars for built in types
class ScalarScanner
# Taken from http://yaml.org/type/timestamp.html
- TIME = /^\d{4}-\d{1,2}-\d{1,2}([Tt]|\s+)\d{1,2}:\d\d:\d\d(\.\d*)?(\s*Z|[-+]\d{1,2}(:\d\d)?)?/
+ TIME = /^\d{4}-\d{1,2}-\d{1,2}(?:[Tt]|\s+)\d{1,2}:\d\d:\d\d(?:\.\d*)?(?:\s*(?:Z|[-+]\d{1,2}:?(?:\d\d)?))?$/
# Taken from http://yaml.org/type/float.html
FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10)