// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class SplitFun {
    public static void main(String[] args) {
        String s = " Fri 7:30 PM, Sat 2 PM, Sun 2:30 PM";
        String[] p = s.replaceAll("[AP]M", "$0X$0").split("X[AP]M");
        for(String p1 : p) {
            System.out.println(p1);
        }
    }
}
