Created
May 21, 2014 20:09
-
-
Save WLPhoenix/13fb155f2d56cee90a07 to your computer and use it in GitHub Desktop.
Java - Split between two characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.*; | |
public class LookbehindSplit { | |
public static void main(String[] args) { | |
String split_regex = "((?<=\\])(?=\\[))"; | |
String[] test = "[1][2][3\\]3][4\\[4]".split(split_regex); | |
for (String s : test) { | |
System.out.println(s); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment