[Solved] REGEXP only numbers withouth parenthesis


I need Numbers without Parenthesis.

Use preg_match_all function with specific regex pattern:

$str="JAVA PROGRAMMING 20 (2016) JAVA PROGRAMMING 30 (2016)";
preg_match_all("/(?!\()\b\d+\b(?!\))/", $str, $matches);

print_r($matches[0]);

The output:

Array
(
    [0] => 20
    [1] => 30
)

0

solved REGEXP only numbers withouth parenthesis