fork(1) download
  1. <?php
  2. $s = 'stuff1 "?" AND stuff\"2=? AND stuff3=\'?\' AND stuff\\\'4=? AND ...';
  3. $p = '?';
  4. $v = '%s';
  5. $r = '/\G((?:(?:[^\x5C"\']|\x5C(?!["\'])|\x5C["\'])*?(?:\'(?:[^\x5C\']|\x5C(?!\')' .
  6. '|\x5C\')*\')*(?:"(?:[^\x5C"]|\x5C(?!")|\x5C")*")*)*?)' . preg_quote($p) . '/';
  7. print preg_match($r, $s) ? preg_replace($r, "$1" . $v, $s) : $s;
  8. ?>
Success #stdin #stdout 0.03s 13120KB
stdin
Standard input is empty
stdout
stuff1 "?" AND stuff\"2=%s AND stuff3='?' AND stuff\'4=%s AND ...