Real CSV is messy
Naive CSV is just str.split(','). Real-world CSV has commas inside quoted fields, escaped quotes inside quoted fields, embedded newlines, and Excel's bizarre dialect choices.
For real CSV processing, use a library — Python csv, JS papaparse, etc. They handle every dialect quirk.
When regex is OK
If your data is single-line, well-formed, and uses standard quoting, this regex extracts each field:
(?:"([^"]*)"|([^,]*))(?:,|$)
For each field: either a quoted string (capturing content) OR an unquoted run (no comma), followed by a comma or end of line.
Walking the line with finditer
Iterate matches; each one is a field. The two capture groups give either the quoted or unquoted form — pick whichever is non-None.
Embedded newlines — give up and use a library
If your CSV can have newlines inside quoted fields (Excel does this), regex isn't enough. The CSV grammar becomes context-sensitive. Use the csv module.