in reply to String Search/Replace

Without using split (I think this is the shortest so far too...):

perl -ple "s/(?<!^)\b(\d+)/$1>1000?0:$1/eg" filename
edit: Nope, see below. :)

edit2: Never mind...