# Validate some important fields with Regex masking

**URL:** <https://community.hubspot.com/t/validate-some-important-fields-with-regex-masking/78085>\
**Category:** HubSpot Ideas\
**Tags:** object\
**Created:** [March 27, 2023, 2:44pm UTC](https://community.hubspot.com/t/validate-some-important-fields-with-regex-masking/78085 "2023-03-27T14:44:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CGuerreroDiaz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cguerrerodiaz/32/51304_2.png) [@CGuerreroDiaz](https://community.hubspot.com/u/CGuerreroDiaz)\
**Post date:** [March 27, 2023, 2:44pm UTC](https://community.hubspot.com/t/validate-some-important-fields-with-regex-masking/78085/1 "2023-03-27T14:44:48Z")

</div>

In Spain, and it’s supposed to be worldwide, there are important fields that needs to be fulfilled correctly by the Sales/Marketing people, for example DNI (Identity National Number) or NIE (Foreign Identification Number).

As these two examples are crutial when filling data to be double checked, even more when there were integrations that uses them presumes that information were correct from origin, it should be a great workaround to allow the use of regular expressions as part of the Masking Rules of these kind of fields.  
For example in Spain these 2 regular expressions are used often in regular Forms to check them:

```auto
var nifRegex = /^[0-9]{8}[TRWAGMYFPDXBNJZSQVHLCKE]$/i;
var nieRegex = /^[XYZ][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/i;

```

---

<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, 11:31pm UTC](https://community.hubspot.com/t/validate-some-important-fields-with-regex-masking/78085/2 "2024-11-14T23:31:06Z")

</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!
