python - String Matching with regular expressions -
i trying write regular expression in python takes string , checks if:
- the last character vowel.
- the last 2 characters not same.
this came with:
[aeiou]$
can me point number 2: last 2 characters not same. example, expresso
valid , expressoo
not valid.
it might easier without regular expression.
e.g if s[-2]!=s[-1] , s[-1] in 'aeiou'
Comments
Post a Comment