cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
indhaa
Super User
Super User

Text Input Pattern Validation for IP Address

Hi

 

So I'm trying to set validation for IP Address field. So when I change the field to 'Number' field it is not allowing '.' . 

So it is set as text field and I have been able to validate using below code. 

!IsMatch(SourceIPInput.Text, Digit & Digit & Digit & Period & Digit & Digit & Digit & Period & Digit & Digit & Digit & Period & Digit & Digit & Digit)

 

However, since the IP address might come from external party, the number of digit might vary. So I would like to update that it allows Digit between(1-3) && Period && Digit between(1-3) && Period && Digit between(1-3) && Period && Digit between(1-3) like this which I unable to do so. 

1 ACCEPTED SOLUTION

Accepted Solutions
ganeshsanap
Memorable Member
Memorable Member

@indhaa Try below formula:

 

!IsMatch(SourceIPInput.Text, "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")

 

Example:

ganeshsanap_0-1621967749349.png


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@indhaa 

Please consider changing your Formula to the following:

!IsMatch(SourceIPInput.Text, "\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}")

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
ganeshsanap
Memorable Member
Memorable Member

@indhaa Try below formula:

 

!IsMatch(SourceIPInput.Text, "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")

 

Example:

ganeshsanap_0-1621967749349.png


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,429)