Try the below one. I have used ?:
to avoid few of the group capturing from your regex. Also, added a positive lookahead (?=\d{4}-|$)
to see whether there is any \d\d\d\d-
format is available at next or its the end of line. You can change this into your pattern if you want(i mean make it into yyyy-mm-dd
format).
string.scan(/((?:\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+[AP][M])\:\s(?:.*?)\:.*?)(?=\d{4}-|$)/) {|match| puts match}
Output:
2014-03-29 10:29:24 AM: John Doe: Hey dude how are you feeling
2014-03-29 10:30:39 AM: Billy: Hey Doe, Im feeling better now.
2014-03-29 10:30:58 AM: Billy: Yup