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




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com