Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
regex² solution in Clear category for Striped Words by juestr
import re
VOWELS = "AEIOUY"
CONSONANTS = "BCDFGHJKLMNPQRSTVWXZ"
striped = re.compile(rf'[{CONSONANTS}]?([{VOWELS}][{CONSONANTS}])*[{VOWELS}]?(?<=..)\Z', re.IGNORECASE)
separator = re.compile(r'[\W]')
def checkio(text):
return sum(1 for w in separator.split(text) if striped.match(w))
April 22, 2019