I am looking for a regex that can match date strings. I'm having trouble specifying the expression "or": /\d{4}-\d{2}-(XX|\d{2})/ does not work, because it returns only part of XX:
"2007-01-XX 2008-01-01".scan(/\d{4}-\d{2}-XX/) ["2007-01-XX"] "2007-01-XX 2008-01-01".scan(/\d{4}-\d{2}-\d{2}/) ["2008-01-01"]
source share