I am not good at regex, thats why I ask here.
Suppose I have the following strings:
let a = 'A,B,C,D',
b = 'A,B|C,D',
c = 'A|B|C|D'
I'd like to split them using a comma ,
, and a pipe |
. Something like:
// a.split(regex)
Or similar while considering the performance.
All the above strings should result in // [A, B, C, D]
How would I write a regex for that. Also, a reference to teach myself regex would be welcome.