+
+
+ public static String[] getGroups(String s, String regexp){
+ Pattern pattern = Pattern.compile(regexp);
+ Matcher matcher = pattern.matcher(s);
+
+ matcher.find();
+ String[] result = new String[matcher.groupCount()];
+
+ for (int i = 0; i< result.length; i++){
+ result[i] = matcher.group(i+1);
+ }
+
+ return result;
+ }