Need help writing expression in regexp!!!
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Megna Hari
am 12 Aug. 2014
Kommentiert: Megna Hari
am 12 Aug. 2014
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.
0 Kommentare
Akzeptierte Antwort
Kelly Kearney
am 12 Aug. 2014
idx = setdiff(1:length(Lines), [cardelm; cardprop; cardmats; cardcs]);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!