Created
January 19, 2011 10:23
-
-
Save taichi/785968 to your computer and use it in GitHub Desktop.
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
static void brace() { | |
String regex = "((?=\\[.+\\])\\[?[a-z]+\\]?)"; | |
Pattern p = Pattern.compile(regex); | |
String[] datas = { "[aaaa]", "[aaaa", "aaaa]", "aaaa" }; | |
for (String s : datas) { | |
System.out.println(s); | |
System.out.println(p.matcher(s).matches()); | |
System.out.println("********"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment