fork(1) download
  1. <?php
  2.  
  3. $file = '[STRING_****] (STRING_*****) /STRING';
  4. $searchContext = 'STRING';
  5. $replaceContext = 'NEW_STRING';
  6. $pattern = '/(?<=[\[(\s])'.$searchContext.'/';
  7. $result = preg_replace($pattern, $replaceContext, $file);
  8. echo $result;
Success #stdin #stdout 0s 83712KB
stdin
Standard input is empty
stdout
[NEW_STRING_****]  (NEW_STRING_*****)  /STRING