I’m trying to split a String in Java. The splits should occur in between two characters one of which is an alphabetic one (a-z, A-Z) and the other numeric (0-9). For example:
String s = "abc123def456ghi789jkl";
String[] parts = s.split(regex);
System.out.println(Arrays.deepToString(parts));
Output should be [abc, 123, def, 456, ghi, 789, jkl]. Can someone help me out with a matching regular expression?
Thanks in advance!
You can use a combination of look-ahead and look-behind: