I am having problems with separating string characters.
These are the raw strings that I have 

```
"MH 02:30pm-04:00pm TF 08:30am-10:00am"
"MTWS 07:00 am-09:00 am, A 08:30 am-11:00 am"
"WS 01:00pm-05:00pm F 11:30am-01:00pm"

```

These strings are database values from a table column named "schedule". I only have read 
privileges so I can't alter data, and the database is huge making it difficult to change 
the format of the schedule column.

My purpose is to extract the class schedule from the string returning the day(MTWHFSA), 
start time and end time. What I have done so far is use StringTokenizer. I have not been 
successful since as you can see, the string that the database returns varies in format. 
It doesn't always return the same format. So I've thought to remove all whitespaces so 
that all will have the same format. Example:

```
"MH02:30pm-04:00pmTF08:30am-10:00am"

```

Please, can anyone help me with how to extract the day(MTWHFSA), start time and end time
from the string above?

Here's the sample code:

```
String sched = "MTWHFS 02:30pm-04:00am W 08:30am-10:00am";
StringTokenizer token = new StringTokenizer(sched,",");
    while(token.hasMoreTokens()){
        StringTokenizer anotherToken = new StringTokenizer(token.nextToken(),"\\ ?\\-?");
        while(anotherToken.hasMoreTokens()){
            System.out.println(anotherToken.nextToken());
        }
    }

```

This outputs correctly:

```
MTWHFS
02:30pm
04:00am
W
08:30am
10:00am

```

But if the string is like this:

```
String sched = "MTWHFS 02:30 pm-04:00 am W 08:30 am-10:00 am";

```

It's output becomes:

```
MTWHFS
02:30
pm
04:00
am
W
08:30
am
10:00
am

```

The output varies when the string format is different, that's why I removed the whitespaces so that the string format will be the same.

But when the string has no white spaces like this:

```
String sched = "MTWHFS02:30pm-04:00amW08:30am-10:00am";

```

It outputs this which is no what I wanted.

```
MTWHFS02:30pm
04:00amW08:30am
10:00am

```

Can anyone help me with this so that this string:

```
String sched = "MTWHFS02:30pm-04:00amW08:30am-10:00am";

```

will output:

```
MTWHFS
02:30pm
04:00am
W
08:30am
10:00am

```

Thanks.