Is there a nice and clean way to find strings of capital letters of size 2-4 in length within a larger string in matlab. For example, lets say I have a string...
stringy = 'I imagine I could FLY';
Is there a nice way to just extract the FLY portion of the string? Currently I'm using the upper() function to identify all the characters in the string that are upper case like this...
for count = 1:length(stringy)
if upper(stringy(count))==stringy(count)
isupper(count)=1;
else
isupper(count)=0;
end
end
And then, I'm just going through the binary vector and identifying when there there are 2-4 1's in the row.
This method is working... but I'm wondering if there is a cleaner way to be doing this... thanks!!!
http://stackoverflow.com/questions/4598315/regex-to-match-only-uppercase-words-with-some-exceptions Good Luck. – Raathigesh Jan 24 '12 at 04:15