<p>Currently, Sprout Fields Phone Field only supports a single mask.</p>

<p>If you need more advanced pattern support, a Regex Field Type is probably the way to go.</p>

<p>Here is one that came up in my search:</p>

<ul>
<li><a href="https://github.com/marionnewlevant/craft-mn_matchinput" rel="nofollow">mn_matchinput</a></li>
</ul>

CC BY-SA 3.0
2016-06-08T15:08:56.497Z
2016-06-08T15:08:56.497Z
Ben Parizek
<p>Is there a way to include multiple validation masks in Sprout Fields? I've tried to do this (for my phone number validation):</p>

<pre><code>#### ####|### ## ###
</code></pre>

<p>Since both of those are valid. If I try to write it out as a real regular expression, like this:</p>

<pre><code>^([0-9]{4}) ([0-9]{4})|([0-9]{3}) ([0-9]{2}) ([0-9]{3})$
</code></pre>

<p>it just fails: <code>preg_match(): Empty regular expression</code></p>

<plugin-sproutforms>
Multiple regexes/masks in Sprout Field validation
# Multiple regexes/masks in Sprout Field validation

(Asked by: username_0 on 2016-06-08)

Is there a way to include multiple validation masks in Sprout Fields? I've tried to do this (for my phone number validation):
#### ####|### ## ###

Since both of those are valid. If I try to write it out as a real regular expression, like this:
^([0-9]{4}) ([0-9]{4})|([0-9]{3}) ([0-9]{2}) ([0-9]{3})$

it just fails: preg_match(): Empty regular expression

**Tags:** plugin-sproutforms


---

## 1 answers

### Answer by username_1 on 2016-06-08. Score: 1

Currently, Sprout Fields Phone Field only supports a single mask.

If you need more advanced pattern support, a Regex Field Type is probably the way to go.

Here is one that came up in my search:

* [mn\_matchinput](https://github.com/marionnewlevant/craft-mn_matchinput)


---

