Re: Regular Expression help!



On Jan 31, 11:10 am, "Suk" <suk...@xxxxxxxxxx> wrote:
Sorry I meant -

open CSVFILE, "data.csv" or die "failed to open changes $!";

while (<CSVFILE>) {

print "$`$3/$2/$1$'" if (/(\d{2})\/(\d{2})\/(\d{4})/);

}

Which just alters the first date- I need to alter all of them

So change your pattern-match-within-an-if to s///g, and print the
results.
s/(\d{2})\/(\d{2})\/(\d{4})/$3/$2/$1/g;
print;

Paul Lalli

.