Skip to main content
Solved

AttributeValidator NOT EQUAL to "VALUE "

  • October 30, 2020
  • 3 replies
  • 46 views

hlouie
Contributor
Forum|alt.badge.img+16

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)).*)$

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

jdh
Contributor
Forum|alt.badge.img+40
  • 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+46
  • 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+65
  • Celebrity
  • November 1, 2020

Alternatively, could you replicate the logic in a tester?