Compare strings which contains the same pattern by ignoring case sensitivity and some expressions like underscores
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ahmet Hakan UYANIK
am 7 Jul. 2022
Kommentiert: Ahmet Hakan UYANIK
am 7 Jul. 2022
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 Kommentare
Akzeptierte Antwort
埃博拉酱
am 7 Jul. 2022
You might remove those expressions to be ignored and unify the strings all to lowercase before doing actual comarison.
Weitere Antworten (1)
Abderrahim. B
am 7 Jul. 2022
Bearbeitet: Abderrahim. B
am 7 Jul. 2022
Unify strings first using eiither upper or lower.
% learn about the functions
doc upper
doc lower
% Examples
upper("abcd")
lower(ans)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Install Products 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!