Any ideas how to split string into 3 parts where by two "delimiters" where the first and the last "delimiters" are letters or numbers respectively?
$str = "%@-H-e-l-l-o-7-9#$%";
would be split like this:
$arr=("%@-","H-e-l-l-o-7-9", "#$%");
and
$str = "Hi$73";
would be split like this:
$arr=("","Hi$73", "");
and
$str = "????????!";
would be split like this:
$arr=("","????????", "!");
and
$str = "!";
would be split like this:
$arr=("!","", "");
and
$str = "";
would be split like this:
$arr=("","", "");
and
$str = "?55?W";
would be split like this:
$arr=("","?55?W", "");
which means it returns an array that consists of 3 elements (always), and the first and last symbols of the second element are numbers or latin/cyrillic letters, and the first and last(third) elements of this array contain absolutely no numbers and letters, and the join of that strings is the source string
Thank you.
Here is a way to do the job:
Where:
pL
stands for any letter in any languagepN
stands for any number in any languageOutput: