470,647 Members | 1,124 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

comma delimited regular expression

I need a regular expression that will validate a double quote comma
delimited list where the odd entries are numeric and the even are
alphabetical. Each pair must also be on a separate line. For example:

"1","Peter"
"2","Paul"
"3","Mary"

I've used the following expression to validate comma delimited lists, but
without the double quotes, numeric/alpha pairing and line return
restriction.

^([A-Za-z0-9]?)+([,]\s?([A-Za-z0-9]?)+)*$

Any help would be appreciated.
Dec 7 '06 #1
1 1738

Bosconian wrote:
I need a regular expression that will validate a double quote comma
delimited list where the odd entries are numeric and the even are
alphabetical. Each pair must also be on a separate line. For example:

"1","Peter"
"2","Paul"
"3","Mary"

I've used the following expression to validate comma delimited lists, but
without the double quotes, numeric/alpha pairing and line return
restriction.

^([A-Za-z0-9]?)+([,]\s?([A-Za-z0-9]?)+)*$

Any help would be appreciated.
Sounds like a regular expression problem, not a JavaScript problem.

Try:

^"([A-Za-z0-9]?)+"([,]\s?\"([A-Za-z0-9]+)")*$

David

Dec 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Elmo Watson | last post: by
9 posts views Thread by Wayne | last post: by
5 posts views Thread by Bosconian | last post: by
6 posts views Thread by billsahiker | last post: by
8 posts views Thread by =?Utf-8?B?TTFpUw==?= | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.