Ask for a rule.

requirements:
customize the delimiter to split the string that meets the following requirements.

  1. string in double quotes, ignoring delimiters. For example, a code b, "c code d" splits to get ["afield," bake,"c < d "] < / parse >
  2. Units within a
  3. string may or may not contain double quotation marks. Such as a code b, "centerd", "e", "f < g", h < / gr >.
The

delimiter is not necessarily a comma, it is custom, it can be a space, it can be any character in amurz. That is, the process of regular generation is probably in the following form:

var splitBy = ","
var reg = new Reg(`...${split}...`)

you can provide some sample strings as verification samples:

comma separator: (half-width comma, (in English)
"rule_id", "time,ti", "module", "dst_port", "nat_src_ip", "nat_src_port", "nat_dst_ip", "nat_dst_port", "comment", "src_mac", "dst_mac", "user", "app_name", "app_id", "category", "subcategory", "risk", "tags", "technology", "mid_session", "1", "1415171952", "fw", "G11A-A0-A9-EA-B9 1", "", "accept", "tcp", "10.10.20.3", "19079", "10.10.14.211", "1521", "00-19-B9-3D-DB-41", "00-1A-A0-A9-EA-B9", "1", ""

"

space separator:
a b "cc d"s ccc" dddd cccccs


str.match(new RegExp(`"[^"]+"|[^${split}]+`, 'g'))
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3aac9-2c247.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3aac9-2c247.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?