473,466 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1807

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Arne | last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com> Subject: Comma delimited array into DB problems Date: 9. februar 2004 10:39 Hi, I have an asp page that takes input from a form on the previous...
4
by: Christine Forber | last post by:
I wonder if anyone knows of some javascript code to check a comma-delimited list of email addresses for basic formating. What I'm looking for is the javascript code to check a form field on form...
3
by: Elmo Watson | last post by:
I've been asked to develop a semi-automated type situation where we have a database table (sql server) and periodically, there will be a comma delimited file from which we need to import the data,...
9
by: Wayne | last post by:
I have the following string: "smith", "Joe", "West Palm Beach, Fl." I need to split this string based on the commas, but as you see the city state contains a comma. String.split will spilt the...
1
by: Sue | last post by:
Hello I'm new to this Regular Expression and need some help. I want to restrict what the user types in a text box. The User can type only A-Z, a-z, 0-9, spaces, comma, dash, period, single...
5
by: SMOlesen | last post by:
Hi I need to split a comma delimited text, however if the comma is between ' ' then no split should occur ie: Class.Value, 'true' , 'some text', 'false', 'text, text, text' should split...
5
by: Bosconian | last post by:
I have a textarea form field for inputting (or pasting) pairs of data. I need a regular expression pattern to validate each line for the following double quote number double quote comma...
6
by: billsahiker | last post by:
I cannot get anything to validate a comma delimited list of stock symbols, like "IBM, MSFT,INTC). symbols are alphanumeric with a maxium length of 5. I want to block multiple, adjacent commas, and...
8
by: =?Utf-8?B?TTFpUw==?= | last post by:
I’m trying to parse out Amazon S3 server logs which are space delimited. However date fields are in the following form: When I try to use the following code to split the record on the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.