fork(2) download
  1. <?php
  2.  
  3. $re = '~(?=(?:\S*[^\w\s]){2,})\S+~';
  4. $str = "you he==rt are my heart 4++5=9 9-8===1 hyphenated-word";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches[0]);
Success #stdin #stdout 0.04s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => he==rt
    [1] => 4++5=9
    [2] => 9-8===1
)