I'm new to Perl and trying to replace a line in a text file using a wildcard. Example file:
This is a text file.
My working (non-wildcard) example:
file=/home/test.user/test.txt
perl -pi -e 's/This is a text file./'"This is a modified text file."'/g' $file
Now trying to edit with a wildcard:
perl -pi -e 's/This*/'"This is a modified text file."'/g' $file
This is incorrect, and outputs:
This is a modified text file. is a text file.
How can I use a wildcard search with /This*/?