L
laredotornado
Hi,
I'm using Java 6. I want to split a Java string on a regular
expression, but I would like to keep part of the string used to split
in the results. What I have are Strings like
Fri 7:30 PM, Sat 2 PM, Sun 2:30 PM
What I would like to do is split the expression wherever I have an
expression matching /(am|pm),?/i . Hopefully I got that right. In
the above example, I would like the results to be
Fri 7:30 PM
Sat 2 PM
Sun 2:30 PM
But with String.split, the split token is not kept within the
results. How would I write a Java parsing expression to do what I
want?
Thanks, - Dave
I'm using Java 6. I want to split a Java string on a regular
expression, but I would like to keep part of the string used to split
in the results. What I have are Strings like
Fri 7:30 PM, Sat 2 PM, Sun 2:30 PM
What I would like to do is split the expression wherever I have an
expression matching /(am|pm),?/i . Hopefully I got that right. In
the above example, I would like the results to be
Fri 7:30 PM
Sat 2 PM
Sun 2:30 PM
But with String.split, the split token is not kept within the
results. How would I write a Java parsing expression to do what I
want?
Thanks, - Dave