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

4 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 10 Nov 2021
Modifié(e) : Fangjun Jiang le 10 Nov 2021
Don't even need regexp()
metForm{i}(end)=='P'

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by