[MarkLogic Dev General] Password Regex

Keith Breinholt lisphack at gmail.com
Thu Oct 6 16:35:37 PDT 2011


I'd like to use fn:matches() to validate that a password has an acceptable
set of characters.

A typical regex for password validation is "/
^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/"

However, if I use that regex like this

  fn:matches( $pwd, "
^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$" )

It throws an invalid regular expression exception.

Is there another expression that I could use to validate length, upper and
lower case letters and at least on number?

-- 
Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20111006/fcb6f728/attachment-0001.html 


More information about the General mailing list