Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Prob a simple answer but I'm pretty new to regex. I need to check a string (password) for the existance of at least one character [a-zA-Z] and also at least one digit. Thanks ahead of time for the help!

 

Sieggy

Posted (edited)

Sorry I deleted my 1st post. I was thinking you needed to match the whole password, which I don't think is possible in all suituations.

 

However you only need to check there is at least 1 alpha and 1 numeric character and I assume you are not worried about matching the whole password.

 

This should work

 

(\d+[a-zA-Z]+)|([a-zA-Z]+\d+)

Edited by John_0025

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...