web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Regular expression to ...
Power Apps
Answered

Regular expression to accept only numeric values along with *

(0) ShareShare
ReportReport
Posted on by 50

Hi, 

 

I have a textbox which should take "*" as default value. Also, it should accept only numeric values up to 1 decimal point and value should not be greater than 100, since it is percentage.

 

Example: Accepted values in Textbox : *, 23.1, 32.1, 100, etc..

Not Accepted : 23.22, 101, etc..

 

Please help me with regular expression or what is the best way to achieve this.

I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @vakula ,

     

    I did a test for you.

    1\ Add a textinput control 'TextInput1' and set its Default property to:

    "*"

     

    Set this textinput control's Onchange property to:

    Set(Thevar,TextInput1.Text);If(IsMatch(Thevar,"^([0-9]|[0-9]\.\d+|[1-9][0-9]|[1-9][0-9]\.\d+|100)$")&&Or(IsBlank(Find(".",Thevar)),Len(Mid(Thevar,Find(".",Thevar)+1))=1),Thevar,Reset(TextInput1))

     

    2\ The result is as follows:

    AAA.gif

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard