Looking for some help with a regular expression.
Got paragraphs of text that contain header lines consisting of a date, in the format of dd-mmm-yyyy HH:mm followed by someones name with a colon concatenated to their name.
E.g.
16-Sep-2010 15:35 Joe Bloggs: some text, some more text 18-Nov-2010 11:38 Patti Smith: some text, more text.
etc. etc.
Looking at a way to identify the date, name: bit so that we can embolden it and/or format it to a new line etc. etc.
Was thinking of running the text through a custom function which would jump through each word at a time (using a space as a delimiter) and using logic to find the start and end bits but it's not ideal, could be slow I guess and prone to errors.
So, another possibility that came to mind was using regular expressions to pattern match the header bits... but my regular expression foo is sorely lacking.
Anyone want to give me the regulat expression pattern match that would find the date, name: bits in the above example?
I.e. it needs to match to the start of the date in the format given and end with the colon after the name(s).
Cheers!
Got paragraphs of text that contain header lines consisting of a date, in the format of dd-mmm-yyyy HH:mm followed by someones name with a colon concatenated to their name.
E.g.
16-Sep-2010 15:35 Joe Bloggs: some text, some more text 18-Nov-2010 11:38 Patti Smith: some text, more text.
etc. etc.
Looking at a way to identify the date, name: bit so that we can embolden it and/or format it to a new line etc. etc.
Was thinking of running the text through a custom function which would jump through each word at a time (using a space as a delimiter) and using logic to find the start and end bits but it's not ideal, could be slow I guess and prone to errors.
So, another possibility that came to mind was using regular expressions to pattern match the header bits... but my regular expression foo is sorely lacking.
Anyone want to give me the regulat expression pattern match that would find the date, name: bits in the above example?
I.e. it needs to match to the start of the date in the format given and end with the colon after the name(s).
Cheers!
d{2})\s(\w+(?