02-11-2010, 11:38 AM
Hi,
I'm ran into a problem with an application i'm using that stores previous updates, as the updates are stored in random order instead of showing the latest updates first. Below is an example of the update list.
Because the updates are ordered randomly ordered i'm looking to use regex to find them and then display the latest update time. Is this possible?
Below is the code i'm using to display an array of the update times:
This then outputs:
From here i'm lost, how can I get the date & time of the latest update?
Regards,
Paul.
I'm ran into a problem with an application i'm using that stores previous updates, as the updates are stored in random order instead of showing the latest updates first. Below is an example of the update list.
Quote:10/02/10 13:46:50 (User):
Update Message 1.
TextTextText
10/02/10 13:48:55 (User):
Update Message 3.
Text TextTextTextTextTextText
TextTextTextTextTextText
10/02/10 13:47:12 (User):
Update Message 2.
Because the updates are ordered randomly ordered i'm looking to use regex to find them and then display the latest update time. Is this possible?
Below is the code i'm using to display an array of the update times:
str updates="10/02/10 13:46:50 (User):[]Update Message 1.[]TextTextText[][]10/02/10 13:48:55 (User):[]Update Message 3.[]Text TextTextTextTextTextText[]TextTextTextTextTextText[][]10/02/10 13:47:12 (User):[]Update Message 2."
str pattern="[0-9]{2}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} \(.*?\)\:"
ARRAY(str) a
findrx(updates pattern 0 4 a)
int i
for(i 0 a.len) out "%i %s" i a[0 i]
This then outputs:
Quote:0 10/02/10 13:46:50 (User):
1 10/02/10 13:48:55 (User):
2 10/02/10 13:47:12 (User):
From here i'm lost, how can I get the date & time of the latest update?
Regards,
Paul.