I have a string
string = 'one Two9three four_Five 67SixSevenEightNine';
I need to split it into the words:
'one' 'two' 'three' 'four' 'five' 'six' 'seven' 'eight' 'nine'
I managed to separate all except the CamelCase, when the lowercase letter is followed by uppercase:
while ~isempty(string)
[str,string] = ...
strtok(string, ...
[' ~@$/#.-:&*+=[]?!(){},''">_<;%' char(9) char(10) char(13) '0-9']);
str = regexprep(str, '[0-9]','');
end
I also can get the index of the pattern, but only if I knew how to insert space or some character between, then I could use the code above once again to split into words:
pattern = '[a-z][A-Z]+';
[pat,idx]=regexp(str, pattern,'match');
any ideas?
Thanks!
Why not replace the camelCase before you do your other processing?