Skip to main content
Solved

AttributeValidator NOT EQUAL to "VALUE "


hlouie
Contributor
Forum|alt.badge.img+15

Is there a way within in AttributeValidator Parameters -> Validation Rule -> Rule Configuration -> NOT EQUAL a value?

 

AttributeValidator

Best answer by ebygomm

I think this will work if you want to fail only exact matches, not contains as well

^(@Value(_projectid).+|(?!@Value(_projectid)).*)$

 

View original
Did this help you find an answer to your question?

3 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • October 30, 2020

Could you use a 0 width negative lookahead in the regex?

Something like PROJECT_ID Contains Regex ^(?!@Value(_projectid))

 

It won't work if _projectid is found entirely within PROJECT_ID.

ex. projectid = 123 and PROJECT_ID= 1234

 


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • October 31, 2020

I think this will work if you want to fail only exact matches, not contains as well

^(@Value(_projectid).+|(?!@Value(_projectid)).*)$

 


hkingsbury
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • November 1, 2020

Alternatively, could you replicate the logic in a tester?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings