Here, the regex that I used a while ago also deals with escaped quotes AND escaped delimiters . This will probably exceed your requirements (column counting), but perhaps it will help you or someone else in the future with their analysis.
(?<=^|(?<!\\)\|)(\".*?(?<=[^\\])\"|.*?(?<!\\(?=\|))(?=")?|)(?=\||$) and broken down as: (?<=^|(?<!\\)\|)
This is complicated, but there is a method for this insanity: other regular expressions that I searched googled will fall if the column at the beginning or end of the line is empty, the delimiting quotes were in odd places, the line or column started or ended with an escaped delimiter and the connection of others scenarios with edge scenes.
The fact that you use the channel as a separator makes this regular expression even more difficult to read / understand. The tip is where you see the pipe itself "|", it is a conditional OR in a regular expression, and when it eludes "\ |", this is your separator.
source share