It's all about the answers!

Ask a question

Post upgrade- One of the validator is not working, It says The Value Validation regular expression has an error


R Z (1252644) | asked Jan 06 '15, 5:09 a.m.

Team,

Post upgrade, One of the validator is not working.

It was working fine before upgrade -3011, But after upgrade 403, it is giving error, The value validation regular expression has an error, The project area asministrator must correct the configuration.

Screenshot attached.

I have tested this on validator configuration page and it is working fine- Screenshot attached Configuration

But i am unable to enter the same in work item form and gives following error.

 


Comments
R Z commented Jan 06 '15, 5:22 a.m.

Attribute properties are String value


R Z commented Jan 06 '15, 5:31 a.m.

It was upgraded from 4001 to 403

One answer



permanent link
Brian Fleming (1.6k11828) | answered Jan 06 '15, 11:38 a.m.
Riaaz,
Entering that regular expression in an online regex tester such as http://www.regextester.com/ results in syntax errors on the + operator so I'm not surprised its failing.  Fixing the syntax errors would result in this:
^([0-9a-zA-Z]{8})+((,[0-9a-zA-Z]{8})+)*$

What is the pattern you are hoping to match with this regular expression?  I imagine the intent was to allow an 8 character string consisting of letters or numbers, or a comma separated list of such strings.  The modified regex I provided above will allow that, but would also allow a 16 character (or any multiple of 8) string, without a comma such as "1234abcd5678efgh".  I suspect this is not your intention.  If my suspicion is true then the + operator isn't even necessary and you could use this regex:
^[0-9a-zA-Z]{8}(,[0-9a-zA-Z]{8})*$
to strictly allow a single 8 character string of letters/numbers or a comma separated list.  If the original intent of the + operator was to ensure a value was entered in the field, I would suggest making the attribute mandatory instead.

Your answer


Register or to post your answer.