- To: Peter Abbott <abbottp_c@xxxxxxxxxxxxxxxx>
- Subject: Re: [SLUG] Perl Question
- From: Matthew Hannigan <mlh@xxxxxxxxxx>
- Date: Wed, 2 Apr 2008 18:03:19 +1100
- Cc: slug@xxxxxxxxxxx
- User-agent: Mutt/1.5.17 (2007-11-01)
On Wed, Apr 02, 2008 at 03:09:44PM +1100, Peter Abbott wrote:
> Can anyone with greater knowledge than myself explain this regex
> behaviour.
> [ ... ]
> if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d
> \d).*?(\d*\.\d\d)L/) {
> $box = $1;
> $name = $2;
> $name =~ s/\.//;
> $place = $4;
> $time = $5;
> $margin = $6;
> }
> Undoubtedly something simple that a self taught dummy has failed to
> grasp.
Doing s/// for $name there resets the $1, $2, .. counters
Matt