Re: Need help w/ reqexp, capture and substitue



This seems to work for me:

#!/usr/bin/perl -w
use strict;


while (<STDIN>) {
chomp;
print "Original: $_\n";
$_ =~ s/^([^@]+)(@.+&\d+&)([&]{5})/$1$2$1$3/;
print "Modified: $_\n";
}

Hope it helps.

Shawn
.