# Phone number validation italy

**URL:** https://community.glideapps.com/t/phone-number-validation-italy/73995
**Category:** Ask for Help
**Created:** [June 9, 2024, 4:29pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995 "2024-06-09T16:29:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 9, 2024, 4:29pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/1 "2024-06-09T16:29:16Z")

</div>

Here I am again, I was noticing that when a user enters their telephone number there is no “control”, in the sense that I live in Italy, and our numbers are 10 numbers long and have a prefix +39, example +39 123 456 7890 , I would like when someone signs up not to be able to enter random numbers (even just one number allows you to proceed), but first the prefix and then that the number must be exactly 10 numbers, and if this condition is not respected a hint or However I can’t continue, can you help me?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [June 9, 2024, 4:48pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/2 "2024-06-09T16:48:48Z")

</div>

A quick and dirty method is to use a number entry component and set the minimum and maximum values to encompass the range of phone numbers you would accept.

Anything more robust would require a custom form and regex to validate the phone number.

---

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 9, 2024, 4:59pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/3 "2024-06-09T16:59:57Z")

</div>

I had already tried with minimum and maximum but maybe I’m wrong with the values ​​and it gives me this error

 ![Screenshot 2024-06-09 alle 18.56.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/d/3dfabc231f905382eb5e5b38ee64a0e9edab6816.jpeg)

don’t pay attention to hint, I inserted it initially because I didn’t know how to “guide” the user to enter his number correctly.  
if so is it difficult to create this regex? how could I do ?

---

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 9, 2024, 5:57pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/4 "2024-06-09T17:57:23Z")

</div>

I thought of this type of solution  
^+39\s\d{3}\s\d{3}\s\d{4}$  
I’m using a check text matches in the table with this formula but it doesn’t work, am I doing something wrong?

 ![Screenshot 2024-06-09 alle 19.54.21](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/c/dc7297a983acf96efcc5028e3337066e056a177e.jpeg)  
alternatively I thought of this for this type of entry +391234567890  
^+39\d{9}$  
but it doesn’t work anyway, maybe I’m doing something wrong…  
 ![Screenshot 2024-06-09 alle 20.06.53](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/8/681478f0486c36d1c75f9cb9d91a054c7d0e755f.png)

---

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 9, 2024, 8:27pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/5 "2024-06-09T20:27:40Z")

</div>

I worked a bit and came to a solution!  
the number must be entered like this +393894375928 and here is what I used:  
^(?:(?:+|00)\d{2,3}|0)\s\*1-9{4}$

Now it works correctly, I’m sharing it for anyone who may need it!

 ![Screenshot 2024-06-09 alle 22.25.46](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/2/5225cd140aba6af4fc6f2c306466d88ce9808ea7.png)

---

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 9, 2024, 8:51pm UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/6 "2024-06-09T20:51:01Z")

</div>

I also found another solution that accepts this type of input:  
393894375928  
39 3894375928  
+393894375928  
+39 3894375928

I’ll share the regex code with you:  
^(?:+?39)?\s_3\d{9}$|^(?:+?39)?\s_0\d{9,10}$

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [June 10, 2024, 2:48am UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/7 "2024-06-10T02:48:38Z")

</div>

The regex is going to be a better solution overall, especially with the country code. But just stepping back to the min/max idea for a bit…your numbers were much too low. What I meant was along the lines of 1000000000 - 9999999999 for your min and max if you were only considering the 10 digit number without the country code.

Min and Max is not the number of digits. It’s that actual lowest and highest acceptable number.

---

<div class="post-metadata">

### Author: ![Maria\_Vallone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maria_vallone/32/68152_2.png) [@Maria\_Vallone](https://community.glideapps.com/u/Maria_Vallone)
#### Post date: [June 10, 2024, 9:26am UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/8 "2024-06-10T09:26:55Z")

</div>

thanks so much this is a better solution for me!

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [June 17, 2024, 9:27am UTC](https://community.glideapps.com/t/phone-number-validation-italy/73995/9 "2024-06-17T09:27:12Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
