PHP Regex Number in Round Brackets
<p>I simply want to get numbers out of a string, where the numbers are contained in round brackets.</p>

<p>i have the following code:</p>

<pre><code>   $type_raw = $row['Type'];
   $length_pattern = '^\(\d+\)$';

   preg_match($type_raw,$length_pattern,$match,PREG_OFFSET_CAPTURE);
   $length = $match[0];
</code></pre>

<p>PHP gives me the following error:</p>

<p>"Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in -filename- -line number->" </p>

<p>Is there something wrong with my regex pattern or what else could it be?</p>

<p>Ok i just changed</p>

<pre><code>  $length_pattern = '^\(\d+\)$';
</code></pre>

<p>to</p>

<pre><code>  $length_pattern = '/^\(\d+\)$/';
</code></pre>

<p>and the same error pops up?</p>
