cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
khansen
Level 5

Lookaround assertions in regex rules

Does the Match Regular Expression rule support lookaround assertions? I can't get them to work. When I type it into the regular expression field, the text remains red.
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

Could you post an example that fails?
0 Kudos
khansen
Level 5

Here is the regular expression I was trying to use:
^(?=.{8,65})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$

I wanted a rule to test a string to see if it is between 8 - 65 characters with at least one numeric, one lower case, and one upper case.

Since I couldn't get it to work with the Match Regular Expression rule, I ended up writing custom code that uses the Java STRING.matches(regular expression) with the above regular expression. It appears to work as expected.
0 Kudos