On Monday, July 16, 2012 09:47:59 AM David Winslow wrote:
> 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
Thanks for clarification. The, bug here is related with the sequence in the 
character list. It looks like is not equal
str = "aaaa-bbbb"
str.split("[-|+|Z]")  Not equal to str.split("[+|-|Z]")

but

str = "aaaa-bbbb"
str.split("[-+Z]") equal to str.split("[+-Z]")

cheers
-- 
Mauricio Pazos

------------------------------------------------------------------------------
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

Reply via email to