Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Regular expression validators

Vineela Durbha
Contributor
November 12, 2018

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

0 votes
Kalyan Chakravarthy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 2, 2022

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 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.

Vineela Durbha
Contributor
November 13, 2018

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