fork download
  1. <?php
  2.  
  3. $re = '/\[(?![^][]*\btable\b)[^][]*]/';
  4. $str = '[kjkj] jkhjkhjk [table] [wedfwefwef] [bgfghfghf] [fvdfvd][sdfsd] [terms] [5465456] jkhjkhjkh';
  5. preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
  6. print_r($matches[0]);
Success #stdin #stdout 0s 82624KB
stdin
Standard input is empty
stdout
Array
(
    [0] => [kjkj]
)