Test, validate and match regular expressions
This regex parses individual fields from a CSV line, handling both quoted and unquoted values. It anchors on the start of the string or a comma delimiter, uses a conditional ((?(1)...)) to detect whether a field is quoted, allowing quoted fields to contain embedded commas, and captures the field content via lookahead for the next delimiter or end of line. Ideal for extracting cell values from comma-separated data.