regexp function that checks if a specific letter is in the end of a cell (last character)
2 ビュー (過去 30 日間)
古いコメントを表示
Ioannis Vourvachakis
2021 年 11 月 10 日
コメント済み: Ioannis Vourvachakis
2021 年 11 月 10 日
This regexp function checks if there is a capital P in metForm folowed by any capital letter.
x= regexpi(metForm(i,1),'(?-i)P[A-Z]');
I want a similar regexp function that will check if the capital P is the last character in metForm (in the end and not followed by anything).
metForm is a cell array like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/796629/image.png)
0 件のコメント
採用された回答
Fangjun Jiang
2021 年 11 月 10 日
編集済み: Fangjun Jiang
2021 年 11 月 10 日
Don't even need regexp()
metForm{i}(end)=='P'
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!