fork download
  1. <?php
  2. $regex = "~\\\\%(*SKIP)(*F)|%[sdf]~";
  3. $string = "match %s, %d and %f but NOT with \%s, \%d and \%f.";
  4. if(preg_match_all($regex,$string,$m)) print_r($m);
  5.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => %s
            [1] => %d
            [2] => %f
        )

)