Use RegExp with JavaScript split()

Here is a short snippet the came out of a forum post here.

I you have a string that, for whatever reason, is concatenated using different delimiters, you can use regexp with javascript split() to build an array of single values.

var s = "one#two#three~four~five";

s.split(/[#~]+/);

The output will be an array containing 5 elements