- Joined
- Apr 24, 2008
- Messages
- 17,844
- Likes received
- 990
- Thanks received
- 182
JDK 1.7.
It seems to work OK for 100 examples then just barfs on one through no other apparent reason that the regexp.
Ill try the others after me lunch.
System.out.println( teamNames );
String[] splitNames = teamNames.split("\\s-\\s") ;
System.out.println( splitNames.length );
System.out.println( splitNames[0] );
name1 - name2
1
name1 - name2
I have discovered the ones that work do come from a different list and I can repeat the fail on everyone from the other list. No idea why that is though, the chars look the same.

Hyphen-minus is 0x2d, en dash is 0x2013. Time for a hex dump![]()