Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Regular Expression

Last post 11-20-2008, 9:18 AM by prometheuzz. 1 replies.
Sort Posts: Previous Next
  •  11-20-2008, 9:09 AM 48561

    Regular Expression

    We use a lot of regular expressions to parse data files.

    I frequently used the following matching pattern ,([^,]*), ie extract the data within the commas.

    I now need to search for a double quote followed by a comma..ie ", .

    How do I it? [^",] looks for a " OR a , I am interested in a AND...

    Any suggestions?

    Thanks


  •  11-20-2008, 9:18 AM 48562 in reply to 48561

    Re: Regular Expression

    momax:
    We use a lot of regular expressions to parse data files.

    I frequently used the following matching pattern ,([^,]*), ie extract the data within the commas.

    I now need to search for a double quote followed by a comma..ie ", .

    How do I it? [^",] looks for a " OR a , I am interested in a AND...

    Any suggestions?

    Thanks


    The stuff between square brackets (they're called character classes) will only match a single character.  The class "[^",]" means: "match any character except a double quote, or comma".

    Try this instead:

    ((?!",).)*

View as RSS news feed in XML