{4,} is greedy, so the ( |$) is not needed. The following is sufficient, shorter and faster:
perl -ple "s/ \d{4,}/ 0/g" infile >outfile
In reply to Re^2: String Search/Replace
by ikegami
in thread String Search/Replace
by crep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |