I need to parse a plaintext file that looks like a log:
11/04/2015 11:45:01: James: Cheers guys, enjoy the weekend!
11/04/2015 12:08:55: Sarah: Sounds good James
11/04/2015 12:09:24: Sarah: What are the details of the trip?
11/04/2015 12:19:06: Leah: Driving up on Friday.
Saturday we'll hit the beach.
Sunday paaaaarty!
11/04/2015 12:29:54: James: Nice.
I'm currently parsing by line break:
var messages = data.split('\n');
But this doesn't work where a message contains a line break (see Leah's message above).
What would be the proper way to parse each new entry? Some kind of regular expression date/time match? or Some Regular Expression which parses date as mentioned above ?
Grateful your help.
\n\nor more complex check if message contains this sequence too\n\nis a double line break and that can appear quite often in IM logs so that won't be strong enough. But matching on double line break followed by date and then time would be sufficient, if I can get the regex for that.