title: How to replace multiple any-character (including newline) in Perl RegEx?
body: <p>This is a simplified description of <a href="http://pastebin.com/yfDvZTyi" rel="nofollow noreferrer">MyTextString.txt</a>:</p>
  
  <p><em>Note: <strong>BlaBla</strong> stands for any character including new line character.</em></p>
  
  <blockquote>
    <p><strong>START</strong> BlaBla-In <strong>END</strong> BlaBla-Out-Between <strong>START</strong> BlaBla-In <strong>END</strong> BlaBla-Out-Between <strong>START</strong> BlaBla-In <strong>END</strong> BlaBla-Out-Between <strong>START</strong> BlaBla-In <strong>END</strong> ...</p>
  </blockquote>
  
  <p>I'm looking for removing <em>text between END and START (BlaBla-Out-Between)</em> to result like this:</p>
  
  <blockquote>
    <p><strong>START</strong> BlaBla-In <strong>END</strong> newline <strong>START</strong> BlaBla-In <strong>END</strong> newline <strong>START</strong> BlaBla-In <strong>END</strong> newline <strong>START</strong> BlaBla-In <strong>END</strong> ...</p>
  </blockquote>
  
  <p>I've a perl file <strong>changes.pl</strong>:</p>
  
  <pre><code>BEGIN {
      @ARGV = map glob("\"$_\""), @ARGV;
  }
  
  s/(END).*?(START)/$1\n$2/sg; #TEST
  </code></pre>
  
  <p>I should execute my replaces using this <strong>CMD line</strong>:</p>
  
  <pre><code>perl -i.bak -p changes.pl My/File/Directory/MyTextString.txt
  </code></pre>
  
  <p>Note: the <em>changes.pl</em> and <em>CMD line</em> are working well as described in this <a href="https://stackoverflow.com/questions/31774499/apply-multiple-find-and-replace-regex-queries-on-multiple-txt-files-using-a-per">question</a> with other RegEx find and replace strings.</p>
  
  <p>But with this RegEx string no modifications happen to MyTextString.txt:</p>
  
  <pre><code>s/(END).*?(START)/$1\n$2/sg;
  </code></pre>
  
  <p>I think every thing regarding my regular expression syntax is OK as it's working well on <a href="https://regex101.com/r/pH8kM4/2" rel="nofollow noreferrer">regex 101 tester</a>.</p>
  
  <p>I'm looking for matching and replacing <strong>any character (including newline)</strong> using mentioned <em>changes.pl</em> and <em>CMD line</em>. Simply, I'm looking for replacing <em>BlaBla-Out-Between</em> with <em>newline</em>.</p>