I have several strings of the format
AA11 AAAAAA1111111 AA1111111
Which is the best (most efficient) way to sepa
This seems to work but when you try to pass something like "111111", it doesn't.
In my application, I am expecting several scenarios and what seems to be doing the trick is this
$referenceNumber = "AAA12132";
$splited = preg_split('/(\d+)/', $referenceNumber, -1, PREG_SPLIT_DELIM_CAPTURE);
var_dump($splited);
Note:
So given the above, you can play around with it based on your use case.
Cheers!