I have a string that I want to split into an array:
SEQUENCE: 1A→2B→3C
I tried the following regular expression:
((.*\s)|([\x{2192}]*))
1. \x{2192} is the arrow mark
2. There is a space after the colon, I used that as a reference for matching the first part
and it works in testers(Patterns in OSX)
but it splits the string into this:
[, , 1, A, , 2, B, , 3, C]
How can I achieve the following?:
[1A,2B,3C]
This is the test code:
String str = "SEQUENCE: 1A→2B→3C"; //Note that there's an extra space after the colon
System.out.println(Arrays.toString(str.split("(.*\\s)|([\\x{2192}]*)")));