Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Regexes all the way solution in Clear category for Striped Words by ale1ster
import re
VOWELS = "AEIOUY"
CONSONANTS = "BCDFGHJKLMNPQRSTVWXZ"
def checkio(text):
return len(re.findall(r'''(?ix) (?#Case-insensitive, verbose)
\b( (?#Surrounding word boundaries)
(?:(?: [{cons}] [{vow}] )+ [{cons}]?) (?#Word starting with consonant)
| (?#Alternative templates)
(?:(?: [{vow}] [{cons}] )+ [{vow}]?) (?#Word starting with vowel)
)\b
'''.format(vow=VOWELS, cons=CONSONANTS), text))
May 21, 2014
Comments: