I try to match different date formats that I parse from different files. One date format is for example: “Thu, 12 Nov 2009 14:17:44 -0000”
When I try to match this string with the first regex I get a true result, when I use the second one I get false.
[A-Za-z]{3},\\s+\\d{2}\\s+[A-Za-z]{3}\\s+\\d{2}.* (1. regex)
[A-Za-z]{3},\\s+\\d{2}\\s+[A-Za-z]{3}\\s+\\d{2}:.* (2. regex)
In my opinion both regex should match the above date format. Where is my failure?
I suspect that the last part “\s+\d{2}:.*” was to match the “14:”, but you have forgotten the year. So the parser expects a “:” but finds the 2nd zero in 2009.
What you need is something like this:
(I think that should pass :))