# \#regex

**URL:** https://community.gravityforms.com/tag/regex/160.md

[Latest](https://community.gravityforms.com/latest.md) · [Categories](https://community.gravityforms.com/categories.md) · [Tags](https://community.gravityforms.com/tags.md)

---

## [Regex verification help](https://community.gravityforms.com/t/regex-verification-help/15834)

<div class="topic-metadata">

**Author:** [@hairyhobo](https://community.gravityforms.com/u/hairyhobo)\
**Replies:** 5\
**Last updated:** [September 7, 2023, 8:51pm UTC](https://community.gravityforms.com/t/regex-verification-help/15834 "2023-09-07T20:51:55Z")

</div>

Hello Just after some help with adding regex validation to fields. I have created some code with my formula and it works perfectly, what i wanted to know is… If i have a 2nd field on the same form, which will use the …

---

## [Regex verification](https://community.gravityforms.com/t/regex-verification/15544)

<div class="topic-metadata">

**Author:** [@hairyhobo](https://community.gravityforms.com/u/hairyhobo)\
**Replies:** 2\
**Last updated:** [July 19, 2023, 10:20am UTC](https://community.gravityforms.com/t/regex-verification/15544 "2023-07-19T10:20:35Z")

</div>

Hello I have been asked to add string baed verification to a form, which is pretty new to me so i am just looking for some advice. The validation would be +20.00 to -20.00, the + or - would be optional. I have the “r…

---

## [Gform\_field\_validation Prohibit Spaces or Special Characters from Field \[RESOLVED\]](https://community.gravityforms.com/t/gform-field-validation-prohibit-spaces-or-special-characters-from-field-resolved/14597)

<div class="topic-metadata">

**Author:** [@user5e7d35feeee2f735](https://community.gravityforms.com/u/user5e7d35feeee2f735)\
**Replies:** 10\
**Last updated:** [April 6, 2023, 5:20pm UTC](https://community.gravityforms.com/t/gform-field-validation-prohibit-spaces-or-special-characters-from-field-resolved/14597 "2023-04-06T17:20:01Z")

</div>

Does anyone have a snippet to prohibit spaces and special characters from the name field?

---

## [Searching entries with Regex](https://community.gravityforms.com/t/searching-entries-with-regex/14373)

<div class="topic-metadata">

**Author:** [@Operator95](https://community.gravityforms.com/u/Operator95)\
**Replies:** 1\
**Last updated:** [February 6, 2023, 1:10pm UTC](https://community.gravityforms.com/t/searching-entries-with-regex/14373 "2023-02-06T13:10:03Z")

</div>

Is there any way to get\_entries using a regular expression as search criteria? Something like: search\_criteria\['field\_filters'\]\[\] = array( 'key'=\> '1', 'operator'=\> 'contains', 'value'=\> /^\[0-9\]{6,6}$/g ); I am not su…

---

## [Field Validation allowing line breaks](https://community.gravityforms.com/t/field-validation-allowing-line-breaks/13243)

<div class="topic-metadata">

**Author:** [@user6041fa1a4e4d2516](https://community.gravityforms.com/u/user6041fa1a4e4d2516)\
**Replies:** 1\
**Last updated:** [August 15, 2022, 3:38pm UTC](https://community.gravityforms.com/t/field-validation-allowing-line-breaks/13243 "2022-08-15T15:38:21Z")

</div>

Hey guys, we want to create a long text field and validate the input. Actual we worked with this setup: // GravityForms: Blocklist & Whitelist// add\_filter( 'gform\_field\_validation\_84\_64', 'custom\_validation3', 10, 4 …

---

## [Strip special characters and spaces from phone submission](https://community.gravityforms.com/t/strip-special-characters-and-spaces-from-phone-submission/13126)

<div class="topic-metadata">

**Author:** [@user61246733c311d325](https://community.gravityforms.com/u/user61246733c311d325)\
**Replies:** 1\
**Last updated:** [July 28, 2022, 7:57pm UTC](https://community.gravityforms.com/t/strip-special-characters-and-spaces-from-phone-submission/13126 "2022-07-28T19:57:19Z")

</div>

Is there a way to strip out everything aside from numbers, from a phone field value that’s submitted? i.e. they enter (123) 456-7890 and the value is recorded as 1234567890 That stripping/replacing of special characte…

---

## [Filtering a specific field \[RESOLVED\]](https://community.gravityforms.com/t/filtering-a-specific-field-resolved/11529)

<div class="topic-metadata">

**Author:** [@user5de141bfd007d093](https://community.gravityforms.com/u/user5de141bfd007d093)\
**Replies:** 5\
**Last updated:** [July 5, 2022, 5:44am UTC](https://community.gravityforms.com/t/filtering-a-specific-field-resolved/11529 "2022-07-05T05:44:54Z")

</div>

In the id\_1 form, I would like to check in the id\_1 (text input) field if someone entered the numbers - if so - to block the form from being sent. It’s a first name field, but standard filtering (mask or regex) can’t han…

---

## [Filter/restrict specific characters or strings in fields](https://community.gravityforms.com/t/filter-restrict-specific-characters-or-strings-in-fields/11605)

<div class="topic-metadata">

**Author:** [@Andre\_B](https://community.gravityforms.com/u/Andre_B)\
**Replies:** 3\
**Last updated:** [January 19, 2022, 4:33pm UTC](https://community.gravityforms.com/t/filter-restrict-specific-characters-or-strings-in-fields/11605 "2022-01-19T16:33:51Z")

</div>

Is there any way to filter/restrict/block specific characters or strings in fields? Example: the text paragraph field When somebody uses “http://” in it, the field displays an error message and the form can’t be sent O…

---

## [Disable Special Characters but allow "Space"](https://community.gravityforms.com/t/disable-special-characters-but-allow-space/11290)

<div class="topic-metadata">

**Author:** [@rheko](https://community.gravityforms.com/u/rheko)\
**Replies:** 6\
**Last updated:** [November 30, 2021, 3:49pm UTC](https://community.gravityforms.com/t/disable-special-characters-but-allow-space/11290 "2021-11-30T15:49:02Z")

</div>

So I want to disable special characters cause a 3rd party integration do not accept the special characters. I have found this code below, but it also doesn’t allow space. So how do I edit the code below, so it allows sp…

---

## [Check my work: gform\_field\_validation filter to prevent fake US phone numbers](https://community.gravityforms.com/t/check-my-work-gform-field-validation-filter-to-prevent-fake-us-phone-numbers/10729)

<div class="topic-metadata">

**Author:** [@user6074b0f5790fe301](https://community.gravityforms.com/u/user6074b0f5790fe301)\
**Replies:** 1\
**Last updated:** [September 10, 2021, 8:11pm UTC](https://community.gravityforms.com/t/check-my-work-gform-field-validation-filter-to-prevent-fake-us-phone-numbers/10729 "2021-09-10T20:11:11Z")

</div>

Our contact form requires a working phone number, and the most common tactic to circumvent this is when people type in obvious fakes such as: (000) 000-0000 (123) 456-7890 I want to use the gform\_field\_validation filt…

---

## [Gravity forms custom mask?](https://community.gravityforms.com/t/gravity-forms-custom-mask/2784)

<div class="topic-metadata">

**Author:** [@user5c9e28e756a6d061](https://community.gravityforms.com/u/user5c9e28e756a6d061)\
**Replies:** 3\
**Last updated:** [September 19, 2019, 4:13pm UTC](https://community.gravityforms.com/t/gravity-forms-custom-mask/2784 "2019-09-19T16:13:24Z")

</div>

Hi, I was wondering how can i do mask like this or is it even possible : I would need to allow user to add field with numbers and letters and hyphen. But seems that hyphen is not possible when using 9, a, \*, ? etc… S…

---

## [Allowable Characters in the Name of a Stripe Feed](https://community.gravityforms.com/t/allowable-characters-in-the-name-of-a-stripe-feed/984)

<div class="topic-metadata">

**Author:** [@uamv](https://community.gravityforms.com/u/uamv)\
**Replies:** 3\
**Last updated:** [February 7, 2019, 8:07am UTC](https://community.gravityforms.com/t/allowable-characters-in-the-name-of-a-stripe-feed/984 "2019-02-07T08:07:16Z")

</div>

I was updating and testing a Stripe integrated form this evening and encountered the following validation error: :warning: This value must match the regex pattern. (/\\A\[\[a-zA-Z0-9\_-\]+\\z/ does not match for the value go…

---

## [Gform\_validation with preg\_match for IP addresses Not Working. Help! :) \[RESOLVED\]](https://community.gravityforms.com/t/gform-validation-with-preg-match-for-ip-addresses-not-working-help-resolved/713)

<div class="topic-metadata">

**Author:** [@od2o](https://community.gravityforms.com/u/od2o)\
**Replies:** 5\
**Last updated:** [January 4, 2019, 2:17am UTC](https://community.gravityforms.com/t/gform-validation-with-preg-match-for-ip-addresses-not-working-help-resolved/713 "2019-01-04T02:17:32Z")

</div>

Hi there, I’m using gform\_validation to make sure a user is entering the following range of IP Addresses: 127. 0.0.0 – 127.255.255.255 127.0.0.0 /8 10. 0.0.0 – 10.255.255.255 10.0.0.0 /8 172. 16.0.0 – 172. …
