- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
^([[email protected]\s]{1,255})$
A general string validation to insure no malicious code is being passed through user input. General enough too allow email address, names, address, passwords, so on. Disallows ‘,\*&$<> or other characters that could cause issues.
[email protected] | My Name | asdf12df
‘,\*&$<> | 1001' string
Author Rating: Not yet rated. Paul Miller
Your Rating
Bad Good

Enter New Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Poor security
Name: JT
Date: 1/8/2015 1:11:45 AM
This actually reduces security rather than increases it. In what context could a user submit "malicious code" into a password field? When the developer has written poor code that allows for injection attacks. Don't punish the user for having a secure password.

Title: Correction
Name: Leandro
Date: 1/1/2011 10:06:30 AM
I found some issues in order clause. Correction below: ^([[email protected]\s]{1,255})$

Title: Correction
Name: Leandro
Date: 1/1/2011 10:06:09 AM
I found some issues in order clause. Correction below: ^([[email protected]\s]{1,255})$

Title: fdsfds
Name: ewer
Date: 4/29/2005 7:49:11 AM

Title: Names w/ apostrophes excluded!
Name: a
Date: 12/19/2003 6:45:15 PM
Beware if using for names of people and companies: "Smith" validates, but "O'Brien," for example, doesn't. This is a common "gotcha" to look out for.

Title: New expression
Name: CG
Date: 6/6/2003 12:01:23 PM
I've posted a small update to this expression I haven't fully tested it though, so there might be some problems, but it works a little better (I think) than this one.

Title: Opps
Name: CG
Date: 6/6/2003 11:48:34 AM
Forgot the quotes I guess. . . it blocks "&lt" etc. (apersand lt)

Title: Sort of works
Name: CG
Date: 6/6/2003 11:47:26 AM
This technically does what it says it does. It blocks &lt &amp and stuff like that, but it doesn't block the literal characters like <>, which is its real problem.

Title: WTF
Name: John
Date: 5/20/2003 8:28:48 PM
Uhm... does this RegExp work? It matches everything I type in the tester.

Copyright © 2001-2021, | ASP.NET Tutorials