Informatics1-2019/HW3
A MathWikiből
(Változatok közti eltérés)
a |
|||
9. sor: | 9. sor: | ||
* It can start with any number of consonants, or a vowel. | * It can start with any number of consonants, or a vowel. | ||
* two vowels should not be next to each other. | * two vowels should not be next to each other. | ||
− | * it should match a whole word | + | * it should match a whole word |
== Hint == | == Hint == | ||
27. sor: | 27. sor: | ||
* chlorophorm | * chlorophorm | ||
* oppo | * oppo | ||
+ | * imimi | ||
+ | * xerxes | ||
− | + | These should '''not match''': | |
* mammut | * mammut | ||
* choroid | * choroid | ||
* opponent | * opponent | ||
+ | * iii | ||
== Deadline == | == Deadline == | ||
2019. October 13<sup>th</sup> 23:59 | 2019. October 13<sup>th</sup> 23:59 |
A lap 2019. október 7., 13:41-kori változata
Tartalomjegyzék |
Regex (3 points)
You have to write a regular expression matching a specific pattern. Use this page: https://regex101.com/ and don't forget to set python flavor.
The expression should find words containing only lowercase, latin characters.
- A word should be matched if it uses only the same vowel every time
- contains at least two vowels
- It can start with any number of consonants, or a vowel.
- two vowels should not be next to each other.
- it should match a whole word
Hint
For vowels you can use:
[aeiou]
And for consonants:
[^aeiou\s]
Example
These should be matched:
- mammal
- chlorophorm
- oppo
- imimi
- xerxes
These should not match:
- mammut
- choroid
- opponent
- iii
Deadline
2019. October 13th 23:59