How to using regex to get match format?
<p>I have a sample code with "name + version name" format like this:</p>

<pre><code>Nokia Belle OS
Symbian Anna OS
Symbian Belle OS, upgradeable to Belle FP1
Symbian OS v9.4, Series 60 rel. 5
</code></pre>

<p>I using this code get the name and version name:</p>

<pre><code>&lt;?php
preg_match_all('/(\b+)\s*OS(\s|,)(\b+)/i', $array[], $arr); // with array[] is name of this text

$name = $arr[1][0];
$version = $arr[2][0];
</code></pre>

<p>But when I try to <code>var_dump</code> the <code>$arr</code>, it return me <code>NULL</code>. So, how can I get the name and version name?</p>
