フィルターのクリア

Need help writing expression in regexp!!!

1 回表示 (過去 30 日間)
Megna Hari
Megna Hari 2014 年 8 月 12 日
コメント済み: Megna Hari 2014 年 8 月 12 日
So I have the following lines of code:
cardelem=find(~cellfun(@isempty, regexpi(Lines, '^C(?!ORD)', 'match')));
cardprop=find(~cellfun(@isempty, regexpi(Lines, '^P(?!LOAD)', 'match')));
cardmats=find(~cellfun(@isempty, regexpi(Lines, '^MAT(?!T)', 'match')));
cardcs=find(~cellfun(@isempty, regexpi(Lines, '^CORD', 'match')));
how do I write the expression for another regexpi function that includes everything that was NOT included in the expressions above? OR should I use the indices I found above to find indices in Lines that were not included above- how would I got about doing that if it's easier? I basically want to find the locations of "other".
Right now all I can think of doing is [^*CP] and something else maybe - I dont even know if that's going in the right direction.

採用された回答

Kelly Kearney
Kelly Kearney 2014 年 8 月 12 日
idx = setdiff(1:length(Lines), [cardelm; cardprop; cardmats; cardcs]);
  1 件のコメント
Megna Hari
Megna Hari 2014 年 8 月 12 日
Thank you Kelly!!! I didn't even know something like setdiff existed!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by