I don't know if I'm reading you right but: perl -p -i.bkup -e "s/.*(test.*?\.txt).*/test29-01-05\.txt/;" p.txt, might do what you want. (see perlrun)
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce
In reply to Re^3: searching for a substring in a string
by kutsu
in thread searching for a substring in a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |