I am making use of the following expression =regexmatch("((?=.*\\d)(?

I am making use of the following expression
=regexmatch("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,})",ri!specifiedPassword)
to check whether the specified string contains atleast one lower case,one upper case, one numerical,one special character and has length of atleast 6 characters. Everything works fine except for one lower case and one upper case validations. The expression returns true for both "welcome@123" and "WELCOME@123"
...

OriginalPostID-67691

OriginalPostID-67691

  Discussion posts and replies are publicly visible

Parents
  • It seems the issue is the flag the author of this plug-in is passing in compile() method:

    Pattern p = Pattern.compile(pattern, 34);

    your expression works fine if the compiled with the default:

    Pattern p = Pattern.compile(pattern);

    if I modify the regexmatch() method to use no flag, it correctly returns "False" for "welcome@123" and "WELCOME@123" but will return true for "WeLCOME@123"
Reply
  • It seems the issue is the flag the author of this plug-in is passing in compile() method:

    Pattern p = Pattern.compile(pattern, 34);

    your expression works fine if the compiled with the default:

    Pattern p = Pattern.compile(pattern);

    if I modify the regexmatch() method to use no flag, it correctly returns "False" for "welcome@123" and "WELCOME@123" but will return true for "WeLCOME@123"
Children
No Data