var splits = str.match(/([^|]*)\|(.*)/);
splits.shift();
The regex splits the string into two matching groups (parenthesized), the text preceding the first | and the text after. Then, we shift the result to get rid of the whole string match (splits[0]).