.NETGURU
Regular Expression
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.


Tony Stephenson
-- Moved from [aspngfreeforall] to [aspngregexp] by Yannick Smits <Click here to reveal e-mail address> --

Could someone please let me have the regex's to validate a password
that:

Must contain between 6 and 10 chars (0-9, a-z, A-Z)
Must contain 1 or more of @#%^&*()

Have tried dozens of ways but can't quite get it.

Thanks

Tony Stephenson

Reply to this message...
 
    
Wayne King
How about this:
^(?=3D .* [@#%^&*()] ) [0-9a-zA-Z@#%^&*()]{6,10}$

Or, this will work too:
^[0-9a-zA-Z@#%^&*()]{6,10}$ (?<=3D [@#%^&*()] .*)
And, this is nearly the same:
^[0-9a-zA-Z@#%^&*()]{6,10} (?<=3D [@#%^&*()] .*) $

I've added whitespace to each to improve readability; either use them =
with the RegexOptions.IgnorePatternWhitespace, or remove all the =
whitespace by hand.

Not sure which of them is most efficient.

I don't know how you will be using these regexes, but keep in mind that =
they use features that are not part of the client-side script regex =
engine used by IE. In other words, they won't work with the =
RegularExpressionValidator when the ClientTarget is "uplevel".

[Original message clipped]


-----Original Message-----
From: Tony Stephenson [mailto:Click here to reveal e-mail address]
Sent: Wednesday, March 13, 2002 4:58 AM
To: aspngregexp
Subject: [aspngregexp] Regular Expression

-- Moved from [aspngfreeforall] to [aspngregexp] by Yannick Smits =
<Click here to reveal e-mail address> --

Could someone please let me have the regex's to validate a password
that:

Must contain between 6 and 10 chars (0-9, a-z, A-Z)
Must contain 1 or more of @#%^&*()

Have tried dozens of ways but can't quite get it.

Thanks

Tony Stephenson

| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Prathima P Rao
I need a regular expression to find for a comma ( ' , ' ) at the end of the
string and delete the same.

Thanks and Regards
Prathima

Reply to this message...
 
    
Terry Voss
This is one way:

If mystring.endswith(",") then
    Mystring=mystring.substr(0,mystring.length-1)
End if

Terry Voss
Developer/Owner
Computer Consulting
Microsoft Certified Partner
http://www.computer-consulting.com
Click here to reveal e-mail address
2403 North Nettleton Street
Spokane WA 99205
Tel: 509-327-7202
Fax: 509-327-2303
http://www.spokaneoutdoors.com

-----Original Message-----
From: Prathima P Rao [mailto:Click here to reveal e-mail address]
Sent: Monday, June 24, 2002 1:52 AM
To: aspngregexp
Subject: [aspngregexp] Regular expression

I need a regular expression to find for a comma ( ' , ' ) at the end of the
string and delete the same.

Thanks and Regards
Prathima

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Pattam, Prasanna

str is your input string

str = new System.Text.RegularExpressions.Regex("^\\w+,$").Replace(str,     
            str.Substring(0, str.Length - 1))

-----Original Message-----
From: Terry Voss [mailto:Click here to reveal e-mail address]
Sent: Monday, June 24, 2002 12:06 PM
To: aspngregexp
Subject: [aspngregexp] RE: Regular expression

This is one way:

If mystring.endswith(",") then
    Mystring=mystring.substr(0,mystring.length-1)
End if

Terry Voss
Developer/Owner
Computer Consulting
Microsoft Certified Partner
http://www.computer-consulting.com
Click here to reveal e-mail address
2403 North Nettleton Street
Spokane WA 99205
Tel: 509-327-7202
Fax: 509-327-2303
http://www.spokaneoutdoors.com

-----Original Message-----
From: Prathima P Rao [mailto:Click here to reveal e-mail address]
Sent: Monday, June 24, 2002 1:52 AM
To: aspngregexp
Subject: [aspngregexp] Regular expression

I need a regular expression to find for a comma ( ' , ' ) at the end of the
string and delete the same.

Thanks and Regards
Prathima

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Prathima P Rao
My input string contains "[xyz]".
I need a regular expression to extract the string enclosed in '[ ]'

Thanks and Regards
Prathima

Reply to this message...
 
    
Prathima P Rao
Sorry, Please excuse for the previous mail.
Rather, I would put up my question like this.
My input string contains "abc def ghi [xyz] lmn"
I need to extract the string "[xyz]" using a regualar expression

Thanks in advance,
Prathima

[Original message clipped]

Reply to this message...
 
 
System.Text.RegularExpressions.Regex
System.Text.RegularExpressions.RegexOptions
System.Web.UI.MobileControls.RegularExpressionValidator
System.Web.UI.WebControls.RegularExpressionValidator




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification