fork(11) download
  1. <?php
  2.  
  3. $string = "Mais de - valor: R$3.21 - Tipo: (+05)";
  4. preg_match('/^([^-]+)[^\(]+(\([^\)]+\))/', $string, $match);
  5. echo $match[1].$match[2];
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
Mais de (+05)