Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Regular expression

This is a discussion on Regular expression within the JavaScript forums, part of the Web Development category; Hi guys, My requirement is that a password string be validated in JavaScript : (It should work for both firefox 3.0 and internet explorer 6 and IE7) 1. It must ...

Go Back   Geeks Talk > Web Development > JavaScript
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 06-16-2009
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 983
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Regular expression

Hi guys,

My requirement is that a password string be validated in JavaScript:

(It should work for both firefox 3.0 and internet explorer 6 and IE7)

1. It must have ONE UPPERCASE.

2. It must have ONE LOWERCASE.

3. It must have ONE DIGIT.

4. SPECIAL CHARACTER is not mandatory.


I am using the regular expression:

var re = /(?=\w*[0-9])(?=\w*[a-z])(?=\w*[A-Z])\w*/;


Here the problem is that Abcd1@123 works.

However Abcd@123 does not work. I think the '@123' is being matched to \w*. Thus the condition of (?=\w*[0-9]) , that a digit is a mandatory is not being satisfied and my password match is failing. Anything after a special character is not being checked.


Plz help me to do this..

Thanks in advance
Riju
Reply With Quote
Sponsored Links
Reply

  Geeks Talk > Web Development > JavaScript

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Regular Expression in QTP radhika_inala QTP 22 07-13-2009 09:08 AM
Regular Expression learqtptesting QTP 2 08-18-2008 03:20 PM
regular expression snigdha_123 QTP 1 12-17-2007 07:37 AM
Regular Expression gouthami123 QTP 3 08-17-2007 11:32 AM
What is Regular Expression? JobHelper Testing Issues 1 12-16-2006 07:17 AM


All times are GMT -4. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved