fork(1) download
  1. <?php
  2.  
  3. $string = "box.last_rollout_revision = dummy";
  4.  
  5. $regex = "/(box\.last_rollout_revision[\s]*=[\s]*)[a-z0-9-_]*([\n]*)/";
  6.  
  7. $test = "234";
  8. $replacementPattern = '${1}'.$test.'$2';
  9.  
  10. echo preg_replace($regex,$replacementPattern,$string);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
box.last_rollout_revision = 234