fork(1) download
  1. import java.util.regex.Pattern;
  2. import java.util.regex.Matcher;
  3.  
  4. class Test
  5. {
  6.  
  7. public static void main(String[] args) {
  8. String s = "(sparker0i@outlook.com,sparker0i) : password";
  9. Pattern pattern = Pattern.compile("\\((.*?),([^)]+)\\) : (.+)");
  10. Matcher m = pattern.matcher(s);
  11. if (m.matches()) {
  12. System.out.println(m.group(1));
  13. System.out.println(m.group(2));
  14. System.out.println(m.group(3));
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 33804KB
stdin
Standard input is empty
stdout
sparker0i@outlook.com
sparker0i
password