/(?<=^|,)([^|,]+)(?=(?:,.*?)?\|(?:.*?,)?\1(?:,|$))/g
/
(?<=^|,) // look-behind for either start-of-line or a comma.
([^|,]+) // capture group: start reading characters that are neither pipe nor comma.
(?= // look-ahead: and these characters must be followed by all of this...
(?:,.*?)? // optionally: a comma and more characters on the left side of the pipe
\| // the center-line pipe must be there
(?:.*?,)? // optionally: more characters followed by a comma
\1 // the matching capture group of characters from earlier
(?:,|$) // must be followed by a comma or the end-of-line
) // end of look-ahead collection.
/g // global: do this over and over again to find multiple matches.