# 459. Repeated Substring Pattern

{% embed url="<https://leetcode.com/problems/repeated-substring-pattern/>" %}

用re写竟然没写出来...老老实实遍历匹配。

```python
class Solution:
    def repeatedSubstringPattern(self, s: str) -> bool:
        len_ = len(s)
        for i in range(1, len_//2+1):
            if len_%i == 0:
                if s[:i] * (len_ // i) == s: return True
        return False
```
