## Uppercase string from the cell array

### Gopalakrishnan venkatesan (view profile)

on 12 Aug 2015
Latest activity Edited by Stephen Cobeldick

on 12 Aug 2015

### Stephen Cobeldick (view profile)

I have a cell array a = {'AA_DFA_DD' ,'DSFA_dfaf' ,'DDDD' , 'DFE1' ,'dfs_DD'}
How can extract only the upper case string from the cell array
How can i do this?
Thanks a lot

#### 1 Comment

Stephen Cobeldick

### Stephen Cobeldick (view profile)

on 12 Aug 2015
+1 for a clear question with input and output examples.

### Stephen Cobeldick (view profile)

on 12 Aug 2015
Edited by Stephen Cobeldick

### Stephen Cobeldick (view profile)

on 12 Aug 2015

regexp(a,'^[^a-z]+\$','match')

Gopalakrishnan venkatesan

### Gopalakrishnan venkatesan (view profile)

on 12 Aug 2015
It works well
Can give me the small explanation of expression
Thanks a lot
Stephen Cobeldick

### Stephen Cobeldick (view profile)

on 12 Aug 2015
^ % match start of string
[^a-z] % match any character EXCLUDING lower-case
+ % repeated one or more times
\$ % match end of string
These are all explained in the documentation:

### Azzi Abdelmalek (view profile)

on 12 Aug 2015
Edited by Azzi Abdelmalek

### Azzi Abdelmalek (view profile)

on 12 Aug 2015

out=a(cellfun(@(x,y) isequal(x,y),a,upper(a)))
or
out=cell(size(a))
idx=cellfun(@(x,y) isequal(x,y),a,upper(a))
out(idx)=a(idx)

#### 1 Comment

Gopalakrishnan venkatesan

on 12 Aug 2015
thanks a lot