Let's say I wanted to replace the line in the file with the following contents
name nAmE naMEbb NAME
And I wanted to replace the word "name" with "dave", but keep a capital copy of the source text. For example, my desired result would be,
dave dAvE daVEbb DAVE
Are there any single line lines for this (preferably in Perl, so I can do in-place replacements in many files)?
EDIT The problem is ambiguous if both lines do not have the same length. Suppose this is so.
string regex replace perl
duckworthd
source share