# Regex for property validation rules

**URL:** <https://community.hubspot.com/t/regex-for-property-validation-rules/93365>\
**Category:** HubSpot Ideas\
**Tags:** object, properties\
**Created:** [November 6, 2023, 2:53pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365 "2023-11-06T14:53:37Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![clmthaz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/clmthaz/32/67906_2.png) [@clmthaz](https://community.hubspot.com/u/clmthaz)\
**Post date:** [November 6, 2023, 2:53pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/1 "2023-11-06T14:53:37Z")

</div>

A type of property validation rule with regular expressions would make it possible to go further and validate fields directly with the correct values.

 ![Screenshot 2023-11-06 at 15.47.41.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/f/2f864b96b21a37594d66ace25a7044fff62c0d8a.png)

---

<div class="post-metadata">

**Author:** ![PeterJr](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/peterjr/32/200520_2.png) [@PeterJr](https://community.hubspot.com/u/PeterJr)\
**Post date:** [November 28, 2023, 2:33pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/2 "2023-11-28T14:33:38Z")

</div>

Yes, please. This would be very useful.

---

<div class="post-metadata">

**Author:** ![Bjorn-Ramboll](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Bjorn-Ramboll](https://community.hubspot.com/u/Bjorn-Ramboll)\
**Post date:** [July 4, 2024, 10:18am UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/3 "2024-07-04T10:18:04Z")

</div>

This would be a great idea!

---

<div class="post-metadata">

**Author:** ![Bjorn-Ramboll](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Bjorn-Ramboll](https://community.hubspot.com/u/Bjorn-Ramboll)\
**Post date:** [July 4, 2024, 10:18am UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/4 "2024-07-04T10:18:28Z")

</div>

This is a great idea!

---

<div class="post-metadata">

**Author:** ![ACortijos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/acortijos/32/37659_2.png) [@ACortijos](https://community.hubspot.com/u/ACortijos)\
**Post date:** [November 7, 2024, 7:03pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/5 "2024-11-07T19:03:44Z")

</div>

So helpful! Can,t wait to try the beta!

---

<div class="post-metadata">

**Author:** ![clmthaz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/clmthaz/32/67906_2.png) [@clmthaz](https://community.hubspot.com/u/clmthaz)\
**Post date:** [November 12, 2024, 12:05pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/6 "2024-11-12T12:05:42Z")

</div>

Glad to see the beta has just been opened!

Can’t wait to give it a try, we’ll finally be able to better guide our teams and get more qualitative data.

---

<div class="post-metadata">

**Author:** ![rwebb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rwebb1/32/2741_2.png) [@rwebb1](https://community.hubspot.com/u/rwebb1)\
**Post date:** [November 14, 2024, 10:58pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/7 "2024-11-14T22:58:52Z")

</div>

👋I’m Rachel from the HubSpot Product team. Regular expressions for property validations are now in private beta (request access via Product Updates; Pro/Enterprise). Would love to hear any feedback you have on this feature via our in-app survey or this thread. Thanks!

---

<div class="post-metadata">

**Author:** ![CBirkett1](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@CBirkett1](https://community.hubspot.com/u/CBirkett1)\
**Post date:** [December 9, 2024, 10:51am UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/8 "2024-12-09T10:51:00Z")

</div>

@rwebb1 Very much pleased to see the beta!  
Some feedback from us. In forms, the validation doesn’t apply unless the field is required. See examples below where a email based validation doesn’t show an error on a non-required field but the same field does when required.

 ![Screenshot 2024-12-09 at 10.50.32.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/d/d891c05fd944586a5649f6b519f34ef79df18f77.png)

 ![Screenshot 2024-12-09 at 10.50.53.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/73c4187b9bd7670b8450a99a7cc28ebca53c0a99.png)

---

<div class="post-metadata">

**Author:** ![rwebb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rwebb1/32/2741_2.png) [@rwebb1](https://community.hubspot.com/u/rwebb1)\
**Post date:** [December 10, 2024, 8:26pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/9 "2024-12-10T20:26:30Z")

</div>

Hi @CBirkett1 - could you please file a Support ticket so my team can take a look? The validation _should_ apply regardless of whether a field is required in the Form.

---

<div class="post-metadata">

**Author:** ![CBirkett1](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@CBirkett1](https://community.hubspot.com/u/CBirkett1)\
**Post date:** [December 11, 2024, 9:56am UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/10 "2024-12-11T09:56:15Z")

</div>

Hi @rwebb1 - I had a ticket with Hubspot support, and they said they would pass it on.  
I couldn’t find a place to comment specifically on this beta, so I thought I’d reach out here!  
Love where it is going though

---

<div class="post-metadata">

**Author:** ![NBBeale](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@NBBeale](https://community.hubspot.com/u/NBBeale)\
**Post date:** [December 30, 2024, 6:08pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/11 "2024-12-30T18:08:53Z")

</div>

@rwebb1 I added some feedback in this thread: [https://community.hubspot.com/t5/HubSpot-Ideas/Increase-character-limit-for-regex-validated-properties/idi-p/1086832](https://community.hubspot.com/t5/HubSpot-Ideas/Increase-character-limit-for-regex-validated-properties/idi-p/1086832)  
If the plan is to retain the 100 character limit for now, that’ll need to be more transparent in the documentation and during the property creation screen. I spent quite awhile attempting to troubleshoot why my regex was showing a test value to be invalid because it just showed the standard error message. But when I finally just created the property and went to a record to test it, the error explicitly indicated that the value must contain 100 characters or less, which was not conveyed during property creation regex setup or testing that is available.  
I would still strongly advocate for increasing the character limit there if possible, but at a minimum the limit needs to be more transparent in documentation and as a part of property creation. Thanks!

---

<div class="post-metadata">

**Author:** ![rwebb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rwebb1/32/2741_2.png) [@rwebb1](https://community.hubspot.com/u/rwebb1)\
**Post date:** [January 6, 2025, 10:11pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/12 "2025-01-06T22:11:55Z")

</div>

Thanks for the feedback @NBBeale ! We are investigating whether it’s possible to increase the 100-character limit. This limit is outlined in the [Knowledge Base](https://knowledge.hubspot.com/properties/regex-validation-rules) but we’re also looking into ways to make it more explicit in-app so it’s more transparent when you are building the property.

---

<div class="post-metadata">

**Author:** ![rwebb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rwebb1/32/2741_2.png) [@rwebb1](https://community.hubspot.com/u/rwebb1)\
**Post date:** [January 6, 2025, 10:12pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/13 "2025-01-06T22:12:25Z")

</div>

Empty

---

<div class="post-metadata">

**Author:** ![rwebb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rwebb1/32/2741_2.png) [@rwebb1](https://community.hubspot.com/u/rwebb1)\
**Post date:** [January 9, 2025, 7:00pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/14 "2025-01-09T19:00:35Z")

</div>

Hi everyone! Some additional updates:  
1. We’ve increased the character limit from 100 to 1,000 for text properties which have regex validation applied.

2. We now have a private beta open for [AI-generated regular expressions for property validations](https://app.hubspot.com/l/product-updates/?update=13968289), which will help you generate regex for property validations with the assistance of AI.

---

<div class="post-metadata">

**Author:** ![DMira](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@DMira](https://community.hubspot.com/u/DMira)\
**Post date:** [January 15, 2025, 11:51am UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/15 "2025-01-15T11:51:36Z")

</div>

But this rule by regex validation, does not work if that property is used in a legacy form editor, it only works with the new form editor. It would be VERY useful that works on legacy editor, as the new form editor do not have the to set the form as RAW HTML like the legacy one does

---

<div class="post-metadata">

**Author:** ![AKocsis3](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@AKocsis3](https://community.hubspot.com/u/AKocsis3)\
**Post date:** [September 22, 2025, 12:32pm UTC](https://community.hubspot.com/t/regex-for-property-validation-rules/93365/16 "2025-09-22T12:32:01Z")

</div>

@rwebb1 I’m so glad that regex is available for field validation -I just wish it wasn’t so limited.

A use case I’d like it to support - and it doesn’t seem to be at the moment - is to create a validation rule that doesn’t allow form submission if the field contains a specific word.

We get a lot of spam submissions thourhg our website Contact Us form from people trying to sell us SEO services so I tried to apply the following regex rule:

^(?!.\*\bSEO\b).+$

Upon reading up on the current capabilities, the validation doesn’t allow for regex exclusion.

Would love to see this feature.
