in reply to Re: String Search/Replace
in thread String Search/Replace
{4,} is greedy, so the ( |$) is not needed. The following is sufficient, shorter and faster:
perl -ple "s/ \d{4,}/ 0/g" infile >outfile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: String Search/Replace
by ChrisR (Hermit) on Aug 31, 2005 at 15:49 UTC | |
|
Re^3: String Search/Replace
by Roy Johnson (Monsignor) on Aug 31, 2005 at 16:10 UTC |