$text =~ m/ "([^"\\]*(\\.[^"\\]*)*)" $1). ,? | ([^,]+) ,? | , /gx; # - Eat any trailing comma. # -OR# 2) NORMAL FIELD # - Capture (to $3) up to next comma. # - (and including comma if there is one) # -OR# 3) EMPTY FIELD # just match the comma. # A field is one of three types of things: # 1) DOUBLEQUOTED STRING # - Standard doublequoted string (nab to