正则表达式以“,”为分隔符分割CSV文件的内容

import java.util.regex.Pattern;
import java.util.regex.Matcher;

public class Test {
    public static void main(String[] args) {
        String str = "dw,\"kk,ll\",\",yioi\",iu,\",\",r3,\"\"\"fte\",l,\"kk\"\"ll\",mm'oo,\"n\"\"dw,erw\"\",e\",, ";
        String regex = "\\G(?:^|,)(?:\"([^\"]*+(?:\"\"[^\"]*+)*+)\"|([^\",]*+))";
        Matcher main = Pattern.compile(regex).matcher(str);
        Matcher mquote = Pattern.compile("\"\"").matcher("");
        while (main.find()) {
            String field;
            if (main.start(2) >= 0) {
                field = main.group(2);
            } else {
                field = mquote.reset(main.group(1)).replaceAll("\"");
            }
            System.out.println("Field [" + field + "]");
        }
        System.out.println("dw kk,ll ,yioi iu , r3 \"fte l kk\"ll mm'oo n\"dw,erw\",e");
    }
}