import re


def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 5140,
            any(
                [
                    all(
                        [
                            "\\MSHTML_C7\\" in event.deep_get("ShareName", default=""),
                            re.match(
                                r"[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}",
                                event.deep_get("ShareName", default=""),
                            ),
                        ]
                    ),
                    all(
                        [
                            "\\MSHTML_C7\\" in event.deep_get("ShareLocalPath", default=""),
                            re.match(
                                r"[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}",
                                event.deep_get("ShareLocalPath", default=""),
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
