Here's a line: (10:18) [PHX] Stoudemire Turnover: Lost Ball (1 TO) Steal: Jackson (1 ST)
I want to match PHX Stoudemire Steal: Jackson these are my patterns: my $steal = 'Steal:\s'; my $team = '\w{3}'; my $player = '\w+'; this is my regex: if ($_ =~ /\[($team)\] ($player).($steal)/) I tried printing $3 and $4, and then $1 and $2, and none of them printed. I'm not sure why. What am I missing? Eventually, I want to match any of these four lines: (10:18) [PHX] Stoudemire Turnover: Lost Ball (1 TO) Steal: Jackson (1 ST) (10:51) [SAN 4-0] Jackson Jump Shot: Made (2 PTS) Assist: Duncan (1 AST) (9:33) [SAN] Duncan Layup Shot: Missed Block: Stoudemire (2 BLK) (5:35) [SAN] Bowen Substitution replaced by Ginobili and when I tried to with this: if ($_ =~ /\[($team)\] ($player).('Assist: '|'Block: '|'Steal: '|'replaced by ')/) and tried to print any of the backreferences, it didn't work either. Any ideas? HEre is my code: ----------------- open(STATS, "stats.txt") or die "statfile\n"; my $pattern = "Foul"; my $assist = 'Assist\s'; my $block = 'Block\s'; my $steal = 'Steal:\s'; my $time = '\d+\:\d\d'; my $team = '\w{3}'; my $player = '\w+'; my $foulType = 'Foul\: (.*) '; my $numFouls = '\w+\s\w+'; my @SAN; my @PHX; my %PHX; my %SAN; while (<STATS>) { if ($_ =~ /\[($team)\] ($player).($steal)/) #|$block|$steal { print "this is 1: $1\n"; print "this is 2: $2\n"; print "this is 3: $3\n"; print "this is 4: $4\n"; } } __________________________________ Do you Yahoo!? Yahoo! Search - Find what you’re looking for faster http://search.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>