fork download
  1. <?php
  2.  
  3. $str = "99-01[10-10-2010]
  4. 59-06[11-12-2016]
  5. 99[333]
  6. 3333-ABC[99]88-XX";
  7.  
  8. $str = preg_replace('/^\d+-/s', 'ALL-', $str);
  9.  
  10. echo $str;
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
ALL-01[10-10-2010]
59-06[11-12-2016]
99[333]
3333-ABC[99]88-XX