def _check_regex_matches(self, node, regex: str) -> bool:
    if isinstance(node, StringNode):
        return (re.match(regex, node.value) is not None)
    return False
def _check_regex_matches(self, node, regex: str) -> bool:
    if isinstance(node, StringNode):
        return (re.match(regex, node.value) is not None)
    return False