MATLAB: Regular Expressions using regexp matchingregexpregular expressions I have a cell array of strings a = {'-2.4,-3';'2,3';'0,5';'-4,-2.5';'A';'V';'C'} Now I want to list those strings which have a "comma". Best Answer a={'-2.4,-3';'2,3';'0,5';'-4,-2.5';'A';'V';'C'}out=a(cellfun(@(x) ~isempty(strfind(x,',')),a)) Related SolutionsMATLAB: Regular expression to match “=” regexp('a == b = d','(?<!=)=(?!=)')This looks for = that are not preceded by = and not followed by = MATLAB: Regular expressions with regexp. >> str = '20070101';>> rgx = '(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})';>> out = regexp(str,rgx,'names')out = year: '2007' month: '01' day: '01' Related QuestionOmit rows from matrixRegular Expressions using regexpRemove cell array content matrix with condition: length of element in cell smaller than specific valueRegexp – match regular expression questionRemoving parentheses around digits using regular expressionsRegexp help
Best Answer