Having problems splitting a long string with preg_match_all <p>I have a variable (text) and it is updated with sentences every time there is an update. When i display this array it turns into 1 long sentence, and i want to break this up in single sentences for readability.</p> <pre><code>&lt;?php $pattern = '~\\d+-\\d+-\\d{4} // \\w+: ~ '; $subject = '01-02-2015 // john: info text goes here 10-12-2015 // peter: some more info '; $matches = array(); $result = preg_match_all ($pattern, $subject, $matches); ?&gt; </code></pre> <p>Which gives this output: </p> <pre><code>$matches: array ( 0 =&gt; array ( 0 =&gt; '01-02-2015 // john: ', 1 =&gt; '10-12-2015 // peter: ', ), ) </code></pre> <p>I'd like the output to be:</p> <pre><code>$matches: array ( 0 =&gt; array ( 0 =&gt; '01-02-2015 // john: info text goes here', 1 =&gt; '10-12-2015 // peter: some more info', ), ) </code></pre> <p>I need the output to be like this so i can use a foreach loop to print each sentence.</p> <p>ps. I'd like to try to get it to work this way first, because otherwise i'd need to change a lot of entries in the database.</p> <p>pps. I'm also not a hero with regex as you can see, so i hope someone can help me out!</p>