Compare strings which contains the same pattern by ignoring case sensitivity and some expressions like underscores
조회 수: 17 (최근 30일)
이전 댓글 표시
Hi,
I have 2 cell array which consist of different strings. I want to find the corresponding strings which contains the same pattern but meanwhile I want to ignore case sensitivity and some expressions like underscores, spaces and hyphen.
Normally with:
exp = '[^ \f\n\r\t\v.,_-]*';
regexpi(CellArray1{i,:},CellArray2,'match');
does the job partly but it compares the strings for whole and if it contains, it does not correspond.
Is there any way to compare strings which contains the same pattern by ignoring the case sensitivity and some expressions?
댓글 수: 0
채택된 답변
埃博拉酱
2022년 7월 7일
You might remove those expressions to be ignored and unify the strings all to lowercase before doing actual comarison.
추가 답변 (1개)
Abderrahim. B
2022년 7월 7일
편집: Abderrahim. B
2022년 7월 7일
Unify strings first using eiither upper or lower.
% learn about the functions
doc upper
doc lower
% Examples
upper("abcd")
lower(ans)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Install Products에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!