Split a String On Capital Letters
Posted: Mon May 10, 2010 10:05 am
Hi
I'm trying to split a sting on capital letters. I'm sure I could do it with a loop through each character and gettting the ASCII value but I was thinking there might be a simple way to do it with preg_split. However I'm not very experienced with Regular Expressions.
Can anybody help?
As an example I'm trying to split the Text "RegularExpression" to an array like Array([0]=>Regular [1]=>Expression)
Also If anybody knows of a good place for notes on Regular Expressions that would be great
Thanks
Nigel
I'm trying to split a sting on capital letters. I'm sure I could do it with a loop through each character and gettting the ASCII value but I was thinking there might be a simple way to do it with preg_split. However I'm not very experienced with Regular Expressions.
Can anybody help?
As an example I'm trying to split the Text "RegularExpression" to an array like Array([0]=>Regular [1]=>Expression)
Code: Select all
print_r(preg_split("[A-Z]","RegularExpression"));
Thanks
Nigel