cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Regular Expression Help

Jump to solution

Hello all,

I recently was thrown back in to the RegEx world( haven't used it since freshman year of college). I pretty much forgot everything so I need some help/guidance.

A)- We have this system that make everyone change their password frequently. This system also has some annoying requirement:

  1. Total length of password = 8---(Regex in line 5 solves this)
  2. No special characters
  3. Cannot have repeating characters or numbers
  4. Can not have ascending or descending consecutive numbers  123, 321, 567,
  5. Must have at least one capital and at least one number----- I have this regex for th- (?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,8}$

B) Is there a way to create one long regex to validate all of the above? If so, I can move on to the next set of validation. Which I can do in nintex forms:

  • The password cannot be too similar to old password
  • cannot have your name

Here I will create 3 columns

  • First name
  • Last Name
  • Previous password

The validation from A) will be checked to first name, last name and previous password.

I have been trying to figure this out on my own but I am throwing in the towel.

thanks,

Jacob

Reply
26 Replies
Highlighted
Automation Master
Automation Master

Re: Regular Expression Help

Jump to solution

Wow, that's really not easy !

I have several questions about your requirements :

  • No special characters : does this means only numbers (from 0 to 9) and letters from a to z and from A to Z ?
  • Can not have ascending or descending consecutive numbers : this is for how many number of numbers ? Only 3 consecutive numbers or 2  ascending or descending consecutive numbers are not allowed ? (I've found this which can be adapted : http://stackoverflow.com/questions/9519640/regex-for-6-digit-int-that-cant-be-sequential-or-repeated...)
  • Is it not a problem if you store the old password clearly in a list ? Because you will also need to store the current password to be able manage that...

Thanks

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Regular Expression Help

Jump to solution

I suggest you to play here >>> RegExr: Learn, Build, & Test RegEx

Reply
Highlighted
Automation Master
Automation Master

Re: Regular Expression Help

Jump to solution

Great site !

0 Kudos
Reply
Highlighted
Not applicable

Re: Regular Expression Help

Jump to solution

Caroline,

  • Correct. They can only use 0-9, a-z and A to Z
  • Cannot be more than 3 consecutive numbers
  • For the old password I am just going to make them type it into another single line of text box where it will validate that new password is not the same as old password.
  • The passwords will not save to a list, rather it will be a form that runs every time someone types into the box. It will never save entered items because of sensitive information.
0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Regular Expression Help

Jump to solution

ok and for this one : Cannot have repeating characters or numbers

Does this means repeating characters and numbers consecutively or not ?

0 Kudos
Reply
Highlighted
Not applicable

Re: Regular Expression Help

Jump to solution

oh sorry! Um so that means that they cannot have repeating characters. So Apple201 will not work, Aple2016 will. The same goes for numbers, you cannot have Jake1111

Passwords that will not work

Jake1111- Repeating numbers

Apple102- Repeating characters

Jump123- Consecutive numbers

Blue201- Does not meet password length requirement

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Regular Expression Help

Jump to solution

to check for repeating characters:

^((?=.*[A-Za-z])(?=.*\d)(?!.*(.)\2)[A-Za-z\d]{8,})$

(?!.*(.)\2) Negative Lookahead - Assert that it is impossible to match the regex below

  • .* matches any character (except newline)
    • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
  • 2nd Capturing group (.)
    • . matches any character (except newline)
  • \2 matches the same text as most recently matched by the 2nd capturing group
Reply
Highlighted
Automation Master
Automation Master

Re: Regular Expression Help

Jump to solution

OK, but does Aplp2016 work ?

0 Kudos
Reply
Highlighted
Not applicable

Re: Regular Expression Help

Jump to solution

Yes Ma'am!

0 Kudos
Reply