Regular Expression Help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Chris Dunaway ("dunawayc[[at]_lunchmeat_sbcglobal[dot]]net")
Date: 10/15/04


Date: Fri, 15 Oct 2004 12:51:10 -0500

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.


Relevant Pages

  • Re: Regular Expression Help
    ... | I need to find all occurrences of a comma in a string EXCEPT where it ... | I figured a regular expression would be the way to go, ... | Kind of like the wizard that helps you build a connection string? ... | of various RegEx test programs, but I would like one to help me construct ...
    (microsoft.public.dotnet.languages.vb)
  • Comma delimited list regular expression correctness proof
    ... only comma separated lists including a null list. ... regular expression accepts all possible strings. ... Any other string either ...
    (comp.programming)
  • Re: while reading mastering perl @+ and @-, not too clear on this
    ... If you want to explore all the gory details of regular expressions then get the book _Mastering Regular Expression_ by Jeffrey E. F. Friedl: ... possible comma) ... I am not totally understanding how the first line is matching standard quoted string. ...
    (perl.beginners)
  • Re: Please help with grep and sed commands
    ... by a comma, ... The input string is "consumed" up to and including the second comma by ... you can apply the same substitution rule twice: ... In perl a regular expression can "look ahead" for an expression ...
    (comp.os.linux.misc)
  • Re: regular expression question
    ... I'd like to use regular expression for checking validity of a field. ... firstname, lastname, organisation23 ... a string + comma then another string + comma then a ...
    (comp.lang.javascript)