Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

regexp cell array problem

Status
Not open for further replies.

KoenDV

Electrical
Nov 15, 2006
1
Hey,

I'm really stuck on this. I'm trying to use regexp twice once for all the files i need to work with and then again to narrow it down even more.

textfiles = dir('*.txt');
filenames = {textfiles.name};
filenames = regexp(filenames, '^sn\d{4}_INS_(LOW|HIGH)_\d+_\d+_(A|B).txt$', 'match');
startfilenames = regexp(filenames, '^sn\d{4}_INS_LOW_\d+_\d+_A.txt$', 'match');

After the first regexp filenames seems to be a cell array. It needs to be an cell array of string to be used by regexp again. I tried tons of thing like char, cellstr, cell, iscell, iscellstr... Tried some functions of the net and avery thing i can think of using round, square and curly brakets. So can anyone please help me?

Thx
Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor