tenderlove/psych — Issue #42: psych tries to parse a string as a date, which is just a string
Author: bjoernbur
Created: 2011-12-15 12:50:55+00:00
State: open

I'm facing a problem with psych, that it tries to convert a normal string ("1110-15-1") into a date.
I assume the problem is the following regular expression:

```ruby
when /^\d{4}-\d{1,2}-\d{1,2}$/
require 'date'
Date.strptime(string, '%Y-%m-%d')
```

I see that the string above looks like a date but what possible ways are there to serialize a normal string with a date-like format?

### Stacktrace ###

```
/usr/lib/ruby/1.9.1/date.rb:1022:in `new_by_frags'
/usr/lib/ruby/1.9.1/date.rb:1046:in `strptime'
/usr/lib/ruby/1.9.1/psych/scalar_scanner.rb:45:in `tokenize'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:191:in `visit_String'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:63:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:227:in `block in visit_Hash'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `visit_Hash'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:63:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:36:in `<<'
/usr/lib/ruby/1.9.1/psych.rb:165:in `dump'
/usr/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
```