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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Alphanumeric
Expression
^[\w ]{0,}$
Description
The alphanumeric patterns I have seen here are unnecessarily long. This is all you need.
Matches
abcdefghijklmnopqrstuvwxyz1234567890
Non-Matches
!@#$%^&*()_+=-?><,./:";'[]\{}|
Author Rating: The rating for this expression. Stupid Flanders
Source Stupid Flanders
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: Correction and Improvements
Name: Todd
Date: 9/5/2006 10:26:19 AM
Comment:
There are a few problems with this post: 1. You stated that the underscore character ("_") is non-matching, but clearly it DOES match, because it is included the the \w directive. Try putting "hello_there" in the test page and you'll see. 2. Instead of using a space character in the match group, for a generic pattern like this it is better to use the whitespace directive ("\s"), so that things like tabs are matched. 3. Instead of using "{0,}", you should use the asterisk ("*"). It is much easier for someone to read and understand with a single asterisk character, and it probably compiles better across all regex flavors. The final pattern should be "^[\w\s]*$"


Title: Perfect
Name: Otis Penn
Date: 9/4/2006 3:05:35 PM
Comment:
This regex does what it needs to do- git'r dun!


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