fork(4) download
  1. <?php
  2. $string = "18/05-01/06 01/06-06/07 06/07-22/08 22/08-14/09 DR Record + 2 21.47 20.24 27.15 20.24 BE Record + 2 24.05 22.68";
  3.  
  4. $parts = preg_split('/[a-z]/i', $string, 2);
  5. var_dump($parts);
  6. $parts = preg_split('/(?<=[a-z])/i', $string, 2);
  7. var_dump($parts);
  8. $parts = preg_split('/(?=[a-z])/i', $string, 2);
  9. var_dump($parts);
  10. $parts = preg_split('/(?=[a-z])|(?<=[a-z])/i', $string, 3);
  11. var_dump($parts);
  12. // your code goes here
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  string(48) "18/05-01/06 01/06-06/07 06/07-22/08 22/08-14/09 "
  [1]=>
  string(62) "R Record + 2 21.47 20.24 27.15 20.24 BE Record + 2 24.05 22.68"
}
array(2) {
  [0]=>
  string(49) "18/05-01/06 01/06-06/07 06/07-22/08 22/08-14/09 D"
  [1]=>
  string(62) "R Record + 2 21.47 20.24 27.15 20.24 BE Record + 2 24.05 22.68"
}
array(2) {
  [0]=>
  string(48) "18/05-01/06 01/06-06/07 06/07-22/08 22/08-14/09 "
  [1]=>
  string(63) "DR Record + 2 21.47 20.24 27.15 20.24 BE Record + 2 24.05 22.68"
}
array(3) {
  [0]=>
  string(48) "18/05-01/06 01/06-06/07 06/07-22/08 22/08-14/09 "
  [1]=>
  string(1) "D"
  [2]=>
  string(62) "R Record + 2 21.47 20.24 27.15 20.24 BE Record + 2 24.05 22.68"
}