×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

regexp cell array problem

regexp cell array problem

regexp cell array problem

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources