fixed the AM/PM, cleaner Regexp generation