# 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:** 1\
**Showing post:** 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;

```

---

_[View the full topic](https://community.hubspot.com/t/validate-some-important-fields-with-regex-masking/78085)._
