Is it possible to parse camel case string in to something more readable.
for example:
- LocalBusiness = Local Business
- CivicStructureBuilding = Civic Structure Building
- getUserMobilePhoneNumber = Get User Mobile Phone Number
- bandGuitar1 = Band Guitar 1
UPDATE
Using simshaun regex example I managed to separate numbers from text with this rule:
function parseCamelCase($str)
{
return preg_replace('/(?!^)[A-Z]{2,}(?=[A-Z][a-z])|[A-Z][a-z]|[0-9]{1,}/', ' $0', $str);
}
//string(65) "customer ID With Some Other JET Words With Number 23rd Text After"
echo parseCamelCase('customerIDWithSomeOtherJETWordsWithNumber23rdTextAfter');
preg_replace
withtrim
to remove the space that it prepends to the string. – Polymorphous