![]() |
Value Regex |
Post Reply
|
| Author | |
Saivignesh
Contributor
Joined: 01.May.2017 Location: Netherlands Points: 17 |
Post Options
Thanks(0)
Quote Reply
Topic: Value RegexPosted: 01.May.2017 at 14:07 |
|
I want to enter values between [0-1]
If I give a restriction in value regex as [0-1] am not able to enter decimal values. How to I set my constraints to achieve it?
|
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Answer Post Options
Thanks(0)
Quote Reply
Posted: 01.May.2017 at 17:23 |
|
There are two approaches to making regular expressions:
If I understand you correctly, what you want is a bit more complex: a decimal value >=0 and <=1, so things like 0, 0.1, 0.999, 1.0, 1, but not -0.1, 3.2, 5e-1 or 17. I'd break that into four alternative parts: 0 or 0.* or 1.0 or 1, so: 0|0\.[0-9]+|1\.0+|1
|
|
![]() |
|
Saivignesh
Contributor
Joined: 01.May.2017 Location: Netherlands Points: 17 |
Post Options
Thanks(0)
Quote Reply
Posted: 03.May.2017 at 11:07 |
|
Thank you so much.!
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |