Regular Expression Help

C

Chris Dunaway

I need to find all occurrences of a comma in a string EXCEPT where it
occurs between quotation marks.

For Example:

Field1,Field2,Field3,Fiel4,"Lastname, Firstname",Field5, Field6

So I need to find the indexes of the commas except for the one that
separates the last and first name.

I figured a regular expression would be the way to go, but I cannot seem to
figure it out.

Does anyone know of any programs that help you build regular expressions?
Kind of like the wizard that helps you build a connection string? I know
of various RegEx test programs, but I would like one to help me construct
one. I evision a utility that could let me select options using a english
like language, but then builds the regex behind the scenes

Thanks for the help

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
S

Sandor Pakh

oooo, that sounds like a great idea.
maybe you should write one of those :)
jk
-sandor

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message | I need to find all occurrences of a comma in a string EXCEPT where it
| occurs between quotation marks.
|
| For Example:
|
| Field1,Field2,Field3,Fiel4,"Lastname, Firstname",Field5, Field6
|
| So I need to find the indexes of the commas except for the one that
| separates the last and first name.
|
| I figured a regular expression would be the way to go, but I cannot seem
to
| figure it out.
|
| Does anyone know of any programs that help you build regular expressions?
| Kind of like the wizard that helps you build a connection string? I know
| of various RegEx test programs, but I would like one to help me construct
| one. I evision a utility that could let me select options using a english
| like language, but then builds the regex behind the scenes
|
| Thanks for the help
|
| --
| Chris
|
| dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
|
| To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
| replace certain words in my E-Mail address.
 
C

Chris Dunaway

oooo, that sounds like a great idea.
maybe you should write one of those :)

I would if I could master RegEx's. They twist my mind!!

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
S

Sandor Pakh

Ok.. here's a link that may give you a bit more insite on how they work.

http://www.codeguru.com/Cpp/Cpp/cpp_mfc/parsing/article.php/c4093/

Keep me posted if you put one together :)
-sandor

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message | On Fri, 15 Oct 2004 14:47:16 -0400, Sandor Pakh wrote:
|
| > oooo, that sounds like a great idea.
| > maybe you should write one of those :)
|
| I would if I could master RegEx's. They twist my mind!!
|
| --
| Chris
|
| dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
|
| To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
| replace certain words in my E-Mail address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top