<?php $re = "/(?<=[0-9])(-)(?=[0-9])/"; $str = "sometext9-9sometext"; $a = preg_split($re, $str, $matches, PREG_SPLIT_DELIM_CAPTURE);print_r($a);
Standard input is empty
Array ( [0] => sometext9 [1] => - [2] => 9sometext )
PHP Notice: Undefined variable: matches in /home/J6kJ8S/prog.php on line 5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!