title: Use preg_match() to find start/stop positions of a substring matching a pattern
body: <p>I want to copy a substring of a string using PHP. </p>
  
  <p>The regex for the first pattern is <code>/\d\|\d\w0:/</code></p>
  
  <p>The regex for the second pattern is <code>/\d\w\w\d+:\s-\s:/</code></p>
  
  <p>Is it possible combining <code>preg_match</code> with <code>strpos</code> to get the exact positions from start to end and then copy it with:</p>
  
  <pre><code>substr( $string, $firstPos,$secPos ) ?
  </code></pre>