A file contains the following types of records, where each record has four entries.
abc, 12:30, love coding, re0*10
cde, informative, "love coding, abcd,ab/cd", 0
The usage scenario is like this, given a file of 1000 records. Each record will be put into a row in the table, the each entry will be put into a corresponding entry. I would like to have a Regex that can help me capture the four entries for each record.
For the first type of record, I can use the following pattern to capture the four entries
^([^,]*),([^,]*),([^,]*),([^,]*)$
For the second type of record, I can use
^([^,]*),([^,]*),"([.*])",([^,]*)$
But how to have a single regular expression to capture these two patterns, which can be used to process the whole file.