Attempting to validate a custom field in JIRA with a regular expression. The accepted integer values are 1 to 16384.
As of now I have this:
^\d(\d)?(\d)(\d)[0-4]?$
Any feedback is appreciated!
Attempting to validate a custom field in JIRA with a regular expression. The accepted integer values are 1 to 16384.
As of now I have this:
^\d(\d)?(\d)(\d)[0-4]?$
Any feedback is appreciated!
I have quickly looked at JIRA documentation and it seems that it's a mess to do simple things like a number range test (however I have perhaps missed something).
You can try to use this pattern that is not the shortest but is designed to match numbers by starting digits (you can improve it putting the most probable starting digits first in each alternation):
^(?:1(?:[0-5][0-9]{0,3}|[7-9][0-9]{0,2}|6(?:[0-2]{0,3}|[4-9][0-9]?|3(?:[0-7][0-9]?|8[0-4]?|9)?)?)?|[2-9][0-9]{0,3})$