I am trying to use regex to validate that a variable is an integer between 1 and n. I was thinking that I could use "matches" then input ^(?:100|[1-9][0-9]|[1-9])$ but that doesn't seem to work. Ideas?
Why use RegEx instead of a calculation?
- Calculations user manual section.
1 Like
Assuming I haven't missed the obvious -- what's a good way of checking for integeriness? Perhaps if TRUNC(x) = x
?
2 Likes
I would have probably used MOD
, but I believe it does not work as expected in KM – so I think your solution is probably the simplest.
1 Like