fork(37) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.regex.*;
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static final String abc="https://127.0.0.1:9443/api/am/store/v0.10/apis/058d2896-9a67-454c-95fc-8bec697d08c9/documents/058d2896-9a67-454c-9aac-8bec697d08c9";
  11. public static final String SWAGGER_BASE_UUID_REGEX = "\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}";
  12.  
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15. Pattern pairRegex = Pattern.compile(SWAGGER_BASE_UUID_REGEX);
  16. Matcher matcher = pairRegex.matcher(abc);
  17.  
  18. while (matcher.find()) {
  19. String a = matcher.group(0);
  20. System.out.println(a);
  21. }
  22.  
  23. }
  24. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
058d2896-9a67-454c-95fc-8bec697d08c9
058d2896-9a67-454c-9aac-8bec697d08c9