close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

strengthening password requirements

Thread began 3/29/2022 4:42 am by Mags | Last modified 4/03/2022 10:55 am by Ray Borduin | 254 views | 4 replies |

Mags

strengthening password requirements

Hi Ray, I'm trying to ensure website users use stronger passwords in future, so I've replaced the previous Entry Length validation on the attached registration page (which only set the min password length as 8 characters) with a Regular Expression validation - I want their passwords to be between 8 and 32 characters long and contain at least one uppercase character, one lowercase character, one digit and one special character. I added this to the server validations as follows:

$WAFV_Errors .= WAValidateRX(((isset($_POST["Registration_group_2_Password"]))?$_POST["Registration_group_2_Password"]:"") . "","^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[*.!@$%^&(){}[]:;<>,.?/~_+-=|\]).{8,32}$",true,10);

However it's not accepting any password I try, however complex. Not sure what I've done wrong?

Sign in to reply to this post

Ray BorduinWebAssist

It looks good to me. What password are you trying? I did a quick test and the password: test1T!regex

seemed to pass the validation.

Sign in to reply to this post
Did this help? Tips are appreciated...

Mags

I tried Testing1regex! (plus various others) and it doesn't pass. The live page is in the PM if you want to try it there.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like there are a few syntax errors in your regular expression particularly with what characters need to be escaped in your list of special characters. Try using this instead:

php:
$WAFV_Errors .= WAValidateRX(((isset($_POST["Registration_group_2_Password"]))?$_POST["Registration_group_2_Password"]:"") . "","/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[*.!@$%^&\(\)\{\}\[\]:;<>,\.\?\/~_+-=\|]/).{8,32}$",true,10);
Sign in to reply to this post
Did this help? Tips are appreciated...

Mags

That still didn't work, it wouldn't accept any password I input, however complex. However I found something that did work, so I'm posting it here in case it helps anyone else:

WAValidateRX(((isset($_POST["Registration_group_2_Password"]))?$_POST["Registration_group_2_Password"]:"") . "","#.*^(?=.{8,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W).*$#",true,10);

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...