Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression for a Password
#4
Not Solved
Hi Ritesh,

I'm a bit confused with your requirements

1. The password contains 8 characters, and fifth character should be numeric, so what should the first 4 characters be? Alphabet letters or numeric or special characters?
2. Also, what should the sixth character be?

Anyway, I post my regular expression to solve your problem (hope I got you)

Code:
^\w{4,4}\d\w[!@#$&*()-_=+\{\}\[\]|\\/;:'",.<>`~]{2,2}$

My regular expression will match with the password which has:
- 8 characters in total
- The first 4 characters should be Alphabet letters
- The fifth character should be numeric
- The sixth character should be Alphabet letters
- The last 2 characters should be special character except % and ^ (I added some special characters on keyboard, you can add some more if you want)
Reply


Messages In This Thread
Regular Expression for a Password - by ritesh - 08-04-2010, 10:33 AM
RE: Regular Expression for a Password - by ngocvo3103 - 11-16-2010, 03:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,272 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,216 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,632 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,416 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,036 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)