class Solution(object): def repeatedSubstringPattern(self, s): return True if re.match(r'(w+)1+$', s) else False