On Sat, Jul 14, 2012 at 6:28 AM, Mauricio Pazos <[email protected]>wrote:
> > String[] time = dateTime[1].split("[+|-|Z]");
> > return time[0]; // the time
> > } Doesn't work because the regex is wrong; it should be "[-+Z]".
> well "|" is the logical operator OR, so "-" or "+" or "Z" is required in
> the
> split operation.
>
Actually, the square brackets denote a character class, so logical OR is
the default behavior and | has no special meaning. String.split("[-|+|Z]")
will split on any of the characters '-' '+' '|' and 'Z' (note that the pipe
character is included in this list! that's probably not intended.) See
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#cc
--
David Winslow
OpenGeo - http://opengeo.org/
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel