, :
var matches = 'a=>aa|b=>b||b|c=>cc'.split(/\b\s*\|\s*\b/g);
Meaning: split, when you see |, surrounded by spaces, and between alphanumeric characters.
This version will also leave d|=dintact.
\bmay introduce errors, although it may not be split if the channel is not between alphanumeric characters, for example, a=>(a+a)|b=>bit will not be split.
Kobi source
share