Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,059
Community Members
 
Community Events
168
Community Groups

Regular expression validators

I am using Regular expression validator  during the create transition.

REvalidator.PNG

I am using [a-zA-Z0-9_=+-] because I need to allow special charterers (_,+,-,=, ).

Am I doing something wrong because this is not working and throwing error whenever i place '_' symbol.

 

2 answers

While using regular expression to validate input data from user. 

So, what ever you wrote a regular expression in attributes should enclosed by parenthesis. 

For example:

([A-Za-z0-9+_= -]*) 

0 votes
Andy Heinzer Atlassian Team Nov 13, 2018

Sometimes you need to escape certain characters in order to have regex search for them. Since the syntax can be a little different depending on the interpreter.  Instead of using your string of

[a-zA-Z0-9_=+-]

try this one

[a-zA-Z0-9\_\=\+\-]

The character of '\' can be used to tell a regex to search specifically for the next character and not use that character's special regex function.   I don't know of any special function for the _ character in regex, but I think you can still try to escape it incase it is causing this to fail to match a character set you are looking for.

No it was not working.

I tried to do as below and it is working

[A-Za-z0-9+_= -]*

Suggest an answer

Log in or Sign up to answer