Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re.search() solution in Clear category for Stressful Subject by martin.pilka
def is_stressful(subj):
import re
"""
https://docs.python.org/3/library/re.html#re.search
'h+' matches 1 or more 'h' chars
\S? matches zero or more non-whitespace chars
"""
return subj.isupper() or subj[-3:] == '!!!' or \
re.search('h+\S?e+\S?l+\S?p+\S?|a+\S?s+\S?a+\S?p+\S?|u+\S?r+\S?g+\S?e+\S?n+\S?t+\S?', subj, re.IGNORECASE) != None
Feb. 1, 2019
Comments: