RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Alphanumeric w spaces and double quotes
Expression
^["a-zA-Z0-9\040]+$
Description
Accepts words or quoted phrases for search strings. Stops SQL injection.
Matches
2 words "Search String"
Non-Matches
hi' or 1=1--
Author Rating: Not yet rated. Jeffrey Roughgarden
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

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: How do you spell "O'Hara"?
Name: Keith Stacy
Date: 7/18/2008 12:48:25 PM
Comment:
The only problem with a whitelist approach like this is that certain names (usually Irish) are punctuated with an apostrophe, or single quote, like "O'Hara". This name would get kicked out by a whitelist approach like this. If it can be refined to permit its use thus as opposed to the use of the single quote as a string delimiter, then that would help.


Title: How do you spell "O'Hara"?
Name: Keith Stacy
Date: 7/18/2008 12:47:02 PM
Comment:
The only problem with a whitelist approach like this is that certain names (usually Irish) are punctuated with an apostrophe, or single quote, like "O'Hara". This name would get kicked out by a whitelist approach like this. If it can be refined to permit its use thus as opposed to the use of the single quote as a string delimiter, then that would help.


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials