View Single Post
Old Apr 27th, 2005, 10:34 AM   #4
spydoor
Programmer
 
Join Date: Feb 2005
Posts: 64
Rep Power: 4 spydoor is on a distinguished road
Looks like a Perl answer may not help you at this point, but since it's in the Perl forum...

my $var = "(02:25:26) user: message";
$var =~ /\((\d+):(\d+):(\d+)\) (.+):(.*)/;

you put paranthesis around the parts of the expression you're trying to capture. Now we also have to escape literal paranthesis.
They get stored in automatic variables $1, $2, $3.... from left to right

so

$1 = 02
$2 = 25
$3 = 26
$4 = user
$5 = message
spydoor is offline   Reply With Quote