import re


def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\regedit.exe"),
                    event.deep_get("OriginalFileName", default="") == "REGEDIT.EXE",
                ]
            ),
            any(
                [
                    " /i " in event.deep_get("CommandLine", default=""),
                    ".reg" in event.deep_get("CommandLine", default=""),
                ]
            ),
            re.match(r":[^ \\\\]", event.deep_get("CommandLine", default="")),
            not any(
                [
                    any(
                        [
                            " -e " in event.deep_get("CommandLine", default=""),
                            " /e " in event.deep_get("CommandLine", default=""),
                            " –e " in event.deep_get("CommandLine", default=""),
                            " —e " in event.deep_get("CommandLine", default=""),
                            " ―e " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            " -a " in event.deep_get("CommandLine", default=""),
                            " /a " in event.deep_get("CommandLine", default=""),
                            " –a " in event.deep_get("CommandLine", default=""),
                            " —a " in event.deep_get("CommandLine", default=""),
                            " ―a " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            " -c " in event.deep_get("CommandLine", default=""),
                            " /c " in event.deep_get("CommandLine", default=""),
                            " –c " in event.deep_get("CommandLine", default=""),
                            " —c " in event.deep_get("CommandLine", default=""),
                            " ―c " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
