regexp function that checks if a specific letter is in the end of a cell (last character)

1 次查看(过去 30 天)
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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2021-11-10
编辑:Fangjun Jiang 2021-11-10
Don't even need regexp()
metForm{i}(end)=='P'

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by