title: How to include EOL in this regex?
body: <p>I have this regex which can extract any substrings like <code>{{string}}</code>
  my regex: <code>'/{{+(.*?)}}/'</code></p>
  
  <p>and I need to modify it where it could extract strings like
  <code>{{ something -enter-char-\r-OR\r\n- somthing }}</code></p>
  
  <pre><code>function replace_callback($matches)
  {
      // just in case
      if ( !isset($matches[1]) || !is_string($matches[1]) ) throw new Exception(__FUNCTION__.': invalid $matches[1].');
      // detected var without brackets
      $var = $matches[1];
  
      // my program's processing on $var
  
      return $var;
  }
  
  $text = ' sdfhh fdfdf {{do:somecoolthings}} sdfggg';
  
  echo preg_replace_callback(
      '/{{+(.*?)}}/',
      'replace_callback',
      $text
  );
  </code></pre>
  
  <p>thanks in advance!</p>
  
  <p>Edit: The people who see questions like this are programmers who don't have as much knowledge about regex, and this question asks a different goal than the other 2 "duplicate" questions, and I'm sure this post will become useful to someone.</p>
  
  <p>final code:</p>
  
  <pre><code>function replace_callback($matches)
  {
      // just in case
      if ( !isset($matches[1]) || !is_string($matches[1]) ) throw new Exception(__FUNCTION__.': invalid $matches[1].');
      // detected var without brackets
      $var = $matches[1];
  
      // my program's processing on $var
  
      return $var;
  }
  
  $text = ' sdfhh fdfdf {{
  do:somecoolthings
  }} sdfggg';
  
  echo preg_replace_callback(
      '/{{(.*?)}}/s',
      'replace_callback',
      $text
  );
  </code></pre>