Handling Quoted Strings - rFronteddu/general_wiki GitHub Wiki

When: CSV, logs

Techniques:

  • State machine parse
  • Regex: ""([^"]*)"": matches text wrapped in double quotes and captures what’s inside the quotes.
    • " → a literal double quote "
    • ( ) → capturing group
    • [^"]* → any number of characters that are NOT a double quote
    • [^ … ] = negated character class (“anything except”)
    • *-> zero or more
    • " → another literal double quote Practice Case
John,"New York, USA",25