472,139 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

Regular Expression Help

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.
Nov 21 '05 #1
3 1641
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 news:uw*****************************@40tude.net...
| 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.
Nov 21 '05 #2
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.
Nov 21 '05 #3
Ok.. here's a link that may give you a bit more insite on how they work.

http://www.codeguru.com/Cpp/Cpp/cpp_...cle.php/c4093/

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

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:di****************************@40tude.net...
| 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.
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Bradley Plett | last post: by
4 posts views Thread by Neri | last post: by
10 posts views Thread by Lee Kuhn | last post: by
3 posts views Thread by James D. Marshall | last post: by
7 posts views Thread by Billa | last post: by
9 posts views Thread by Pete Davis | last post: by
3 posts views Thread by Zach | last post: by
25 posts views Thread by Mike | last post: by
3 posts views Thread by Mr.Steskal | last post: by
18 posts views Thread by Lit | last post: by
reply views Thread by leo001 | last post: by

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.