<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Regex to block specific email domains on Contact Email property — HubSpot regex engine compat... in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263195#M87290</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/183000"&gt;@shridhar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the Community! Thanks for the detailed breakdown of what you've already tried. To start here I'd like to include our guide on the matter and a community article that may point you in the right direction :&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/properties/regex-validation-rules#example-expressions" target="_blank"&gt;Example expressions&lt;/A&gt;&lt;/LI&gt;
 &lt;LI&gt;&lt;A href="https://community.hubspot.com/t5/Lead-Capture-Tools/Advanced-Regex-Server-Side-Email-Validation-to-Block-Bot-Form/td-p/1233235" target="_blank"&gt;Advanced Regex + Server-Side Email Validation to Block Bot Form Submissions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color:#ffffff;color:#33475b;"&gt;I'd like to tag in some of our Top Contributors to see if they have any tips and tricks on this!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color:#ffffff;color:#33475b;"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811"&gt;@zach_threadint&lt;/a&gt;&lt;/SPAN&gt;, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2062"&gt;@Josh&lt;/a&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/537570"&gt;@RubenBurdin&lt;/a&gt;&lt;/SPAN&gt; &amp;nbsp;-- Do you have any suggestions for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1058256"&gt;@Shridhark&lt;/a&gt;&lt;/SPAN&gt; on this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Sam, Community Manager&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2026 15:54:00 GMT</pubDate>
    <dc:creator>SamTassey</dc:creator>
    <dc:date>2026-03-30T15:54:00Z</dc:date>
    <item>
      <title>Regex to block specific email domains on Contact Email property — HubSpot regex engine compatible?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263152#M87287</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi Community,&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm trying to block specific competitor email domains across all our &lt;STRONG&gt;150+ forms&lt;/STRONG&gt;&amp;nbsp;adding domains to each forms is very big task. So I have been exploring the CRM Property Validation approach (Settings → Data Management → Properties → Email → Rules → Custom regex).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;BR /&gt;Our forms are on the V4 forms engine, so the Forms API PATCH endpoint returns a 403 BANNED error for write operations. HubSpot support confirmed there is no supported bulk update path for configuration.blockedEmailDomains on V4 forms. The suggested workaround was to use a custom regex rule on the Contact Email property.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt;&lt;BR /&gt;I'm struggling to write a regex that HubSpot's engine accepts. My goal is simple — block emails from example1.com and example2.com, while allowing all other valid email addresses.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's what I've tried so far:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. ^(?!.*@(example1\.com|example2\.com)).+$&lt;BR /&gt;→ Error: "The regex is not valid"&lt;/P&gt;&lt;P&gt;2. ^[\w.-]+@(?!example1\.com|example2\.com)[\w.-]+\.[a-zA-Z]{2,}$&lt;BR /&gt;→ Error: "The regex is not valid"&lt;/P&gt;&lt;P&gt;3. ^(?!example1\.com|example2\.com).*$&lt;BR /&gt;→ No error but blocked ALL emails including valid ones&lt;/P&gt;&lt;P&gt;4. ^(?:example1\.com|example2\.com)$&lt;BR /&gt;→ Only allowed example1.com and example2.com, blocked everything else&lt;/P&gt;&lt;P&gt;I also tried the "Generate with AI" feature in the regex field. It worked for blocking a single domain (generated ^(?:example\.com)$ which makes me think HubSpot's regex engine matches against the domain part only, not the full email). But when asked to block specific domains while allowing everything else, the AI generated an incorrect regex that blocked all emails.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My questions:&lt;/STRONG&gt;&lt;BR /&gt;1. Does HubSpot's regex engine match against the full email address or just the domain part?&lt;BR /&gt;2. Is negative lookahead (?!) supported in HubSpot's regex engine?&lt;BR /&gt;3. Can anyone share a working regex that blocks specific domains while allowing all others?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any help from the community would be greatly appreciated!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Shridhar&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2026 13:18:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263152#M87287</guid>
      <dc:creator>Shridhark</dc:creator>
      <dc:date>2026-03-30T13:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to block specific email domains on Contact Email property — HubSpot regex engine compat...</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263195#M87290</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/183000"&gt;@shridhar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the Community! Thanks for the detailed breakdown of what you've already tried. To start here I'd like to include our guide on the matter and a community article that may point you in the right direction :&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/properties/regex-validation-rules#example-expressions" target="_blank"&gt;Example expressions&lt;/A&gt;&lt;/LI&gt;
 &lt;LI&gt;&lt;A href="https://community.hubspot.com/t5/Lead-Capture-Tools/Advanced-Regex-Server-Side-Email-Validation-to-Block-Bot-Form/td-p/1233235" target="_blank"&gt;Advanced Regex + Server-Side Email Validation to Block Bot Form Submissions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color:#ffffff;color:#33475b;"&gt;I'd like to tag in some of our Top Contributors to see if they have any tips and tricks on this!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color:#ffffff;color:#33475b;"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811"&gt;@zach_threadint&lt;/a&gt;&lt;/SPAN&gt;, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2062"&gt;@Josh&lt;/a&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/537570"&gt;@RubenBurdin&lt;/a&gt;&lt;/SPAN&gt; &amp;nbsp;-- Do you have any suggestions for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1058256"&gt;@Shridhark&lt;/a&gt;&lt;/SPAN&gt; on this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Sam, Community Manager&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2026 15:54:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263195#M87290</guid>
      <dc:creator>SamTassey</dc:creator>
      <dc:date>2026-03-30T15:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to block specific email domains on Contact Email property — HubSpot regex engine compatibl</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263221#M87292</link>
      <description>&lt;P&gt;Regarding your question #2, the docs say the regex rule uses RE2 syntaxt and&amp;nbsp;RE2 does not support&amp;nbsp;lookahead/lookbehind:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api-reference/crm-property-validations-v3/guide" target="_blank"&gt;https://developers.hubspot.com/docs/api-reference/crm-property-validations-v3/guide&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Have you tried&amp;nbsp;EMAIL_BLOCKED_DOMAINS?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2026 17:16:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Regex-to-block-specific-email-domains-on-Contact-Email-property/m-p/1263221#M87292</guid>
      <dc:creator>FaramarKolivand</dc:creator>
      <dc:date>2026-03-30T17:16:48Z</dc:date>
    </item>
  </channel>
</rss>

