I know that to split by strings I can use e.g. x.split(/Age:|Date:/g);
How split a string in jquery with multiple strings as separator and to split by a character, like :
I can use x.split(':');
I need to split a string by the following, if applicable
:
am
AM
pm
PM
Tried both of these but they don't work.
var array = str.split('/:|am|AM|pm|PM/g');
var array = str.split('/\:|am|AM|pm|PM/g');
var array = str.split('/(:|am|AM|pm|PM)/g');
JSFiddle https://jsfiddle.net/dkasce2e/1/