> See if this example gets you going.
> 
> James
> 
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> while (<DATA>) {
>       if (m/\[([A-Z0-9 -]+)\]
> (\w+).+(?:Steal|Assist|Block|replaced by): 
> (\w+)/) {
>               print "$1 $2 $3\n";
>       }
> }


That got me started.  I do have a question though
about your regex.

This backreference is $1, and matches the team
abbreviation.
([A-Z0-9 -]+)

This one is $2, and matches the first name:
(\w+)

And this one I'd think should be $3, and match Steal
or Assist etc., but the results don't say that.

(?:Steal|Assist|Block|replaced by)

Instead, $3 is this, and matches the second name.
(\w+)

If backreferences are supposed to be in parentheses,
why isn't this
(?:Steal|Assist|Block|replaced by)
a backreference?

Thanks.

__________________________________
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>


Reply via email to