What is the regex used for the validation of custom field URL in JIRA.
I need to know the valid pattrens on the same.
It's not a regular expression, it's a bit of code that uses java.net.url
The "valid patterns" it checks for are simply "any valid url, as defined by the standards"
If you are needing a Regex to validate a url against that works like Jira validation, before pushing an issue through the API then try this:
^([a-zA-Z]+:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:)?([0-9]{1,5})?(\/.*)?$
This seems to behave like JIRA does.
You might need to massage the string to deal with the slashes in whatever language you are using.
I am not great at Regex, so if anyone wants to optimise or improve this, please have at it.
It looks like you're new here. Sign in or register to get started.