fork download
  1. <?php
  2.  
  3. $data = "This is my text how do you like it @[John Doe (#6)](client:6) and do you have any thoughts @[Jane Doe (#7)](client:7)";
  4.  
  5. $regex = "~@\[[^][]+\]\s*\(\K[^()]+~";
  6.  
  7. preg_match_all($regex, $data, $matches);
  8.  
  9. print_r($matches);
  10.  
  11. ?>
  12.  
Success #stdin #stdout 0.02s 26716KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => client:6
            [1] => client:7
        )

)