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