The outreach engine scans drafts using a boundary-matching regular expression that checks for banned competitor domains surrounded by non-word and non-hyphen boundaries while allowing leading dots to catch subdomains without falsely matching partial words.

flowchart TD
    Pattern["Regex: (?<![\w-])domain\.com(?![\w-])"]
    
    Pattern --> Test1["domain.com"]
    Pattern --> Test2["sub.domain.com"]
    Pattern --> Test3["otherdomain.com"]
    Pattern --> Test4["domain.company"]

    Test1 --> Pass1["Match: Exact Domain"]
    Test2 --> Pass2["Match: Valid Subdomain Dot Boundary"]
    Test3 --> Fail1["Reject: Preceding Word Character"]
    Test4 --> Fail2["Reject: Trailing Word Character"]

    Pass1 --> Flag[Trigger Banned Policy]
    Pass2 --> Flag
    Fail1 --> Clear[Allow Draft]
    Fail2 --> Clear