I'm trying to learn regex and get an array of words / numbers from these possible strings:
String: 'getUser100Profile'
Return: array('get', 'user', '100', 'profile')
String: 'put100'
Return: array('put', '100')
String: 'post'
Return: array('post')
Here is my snippet which is not working:
$name = 'get100';
$names = preg_split('/(?=[A-Z\d+])/', $name);
Return: array('get', '1', '0', '0');
Should return: array('get', '100');