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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^([A-Za-z0-9]\s?)+([,]\s?([A-Za-z0-9]\s?)+)*$
Description
This regular expression can be used to parse a comma delimited string. Leading whitespaces (at the beginning of the entire string) and ending commas are not acceptable. Any combination of letters and numbers with zero or one white space between them are acceptable. Note: To change the delimiter, simply replace the comma in the square brackets to the delimiter of choice.
Matches
123, 4567, 8901 | abc, defghi, jklmn | abc123
Non-Matches
abc123 | abc123, | ,abc123
Author Rating: The rating for this expression. Rehan Azam
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: Doesn't work
Name: CHill60
Date: 2/20/2013 4:29:22 AM
Comment:
Tried a variety of strings and a variety of delimiters - didn't work for any of them


Title: Does not work
Name: Slacker
Date: 12/20/2006 7:52:35 AM
Comment:
I tried this and it does not seem to work as well. My test string is this: 0,4,Header Indicator It missed the number 4 completely :(


Title: Non functioning?
Name: Jordy Boom
Date: 9/10/2005 7:08:33 PM
Comment:
Test string: test, test Result: Group 1 matched: %1 : 't' %2 : ',test' %3 : 't' Doesn't seem like it works.


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