https://leetcode.com/problems/find-the-longest-balanced-substring-of-a-binary-string/description/


Success


```python
import re

class Solution:
    def findTheLongestBalancedSubstring(self, s: str) -> int:
        longest = 0
        for index1, _ in enumerate(s):
            for index2, _ in enumerate(s[index1:]):
                if index1 + index2 < len(s):
                    sub_string = s[index1: index1+index2+1]
                    if re.fullmatch(r"0+1+", sub_string) != None:
                        if sub_string.count("0") == sub_string.count("1"):
                            if len(sub_string) > longest:
                                longest = len(sub_string)
        return longest
```
