import reclass RegularExpression: def __init__(self, regex): self.regex = regex def match(self, input_string): pattern = "^" + self._convert_to_regex(self.regex) + "$" return bool(re.match(pattern, input_string)) def search(self, input_string): pattern = self._convert_to_regex(self.regex) return re.findall(pattern, input_string) def _convert_to_regex(self, regex): regex = regex.replace('+', '|') return regex# Example usageregex = "((5)(a+b))*(c)"s = "5ac"regular_expression = RegularExpression(regex)matches = regular_expression.search(s)print(matches) ### it is supposed to print all the occurrences of s in regex but it doesn't the output is [('5a', '5', 'a', 'c')]and I am not sure how the star(*) functions in the re module because it doesn't seems to work as I understand and it is also changes the output if I put Parentheses on b or on a or another Parentheses on c or 5and in case regex = "5(a+b)*c"the output is ['a']