http://www.perlmonks.org?node_id=812330


in reply to date replace

Is this what you want?
#!/usr/bin/perl use strict; while (<DATA>) { s/\d\d(.*)/$1/ if /\d{8}/; print; } __DATA__ 20070820 070223 20080929