Regular Expressions 101

Enterprise

Community Library

Your search did not match anything

Community Library Entry

1

Regular ExpressionOpen Workspace

@"
^(?!$)(?:(?<=^|,)(?<start>)(?<quote>"")?(?(quote)(?>[^""]|"""")+\<quote>(?<-quote>)|[^,\n]*)(?<value-start>),?)+$
"
gm

Description
Created·2024-08-12 02:28
Type·Match
Flavor·.NET 10.0 (C#)

Parses CSV files using comma (,) as delimiter and double quote (") as quoted-field tag. Features:

  • Respects empty fields, including at the beginning and at the end of the line
  • Respects line breaks in quoted fields
Submitted by kevinhp
Open Workspace