M_Jones92
(Michelle Jones)
1
Hello,
I am having an issue with my Is Match action. I would like it to check if the input is a single digit between 1-9.
I have tried the following in the Pattern section with no luck:
“[1-9]”
“1-9”
“d/[1-9]”
I left the default RegexOption choices (IgnoreCase, Compiled) I’m not sure what these do.
Thanks for your help!
Michelle
dineshary
(Dinesh B)
2
“[1-9]” works perfect for me.
Main.xaml (5.5 KB)
M_Jones92
(Michelle Jones)
3
Try passing in 32 it will return as true.
[Edit] It seems to accept everything, I tried 8, 9, 10, 11, 12, 100 etc.
arivu96
(Arivazhagan A)
4
Hi @M_Jones92,
Try this pattern
Pattern :(?<!\S)\d(?![^\s?!])
Regards,
Arivu
M_Jones92
(Michelle Jones)
5
@arivu96 This worked perfectly just had to remove the last ).
I used: “(?<!\S)\d(?![^\s?!])”
Thank you!
M_Jones92
(Michelle Jones)
6
@arivu96 One more question for you because this has been driving me crazy all day and I really don’t understand regular expressions.
What pattern should I use in an is match action if I just want to check if its 30 or 31?
I tried “[30,31]” but it is accepting 40, 50, etc.
Thank you!
arivu96
(Arivazhagan A)
7
Hi @M_Jones92,
Pattern: (30|31)
For testing purpose you can use the below site to validate the expression.
https://regex101.com
Regards,
Arivu
1 Like