fork download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. String unescapedStr = "Retrying for error: [[\"billing\",\\{u'non_field_errors': [u'Invalid payment email provided']}\"]]";
  11. String pattern = "Retrying for error:.*\\[u'([^']+)";
  12. Pattern r = Pattern.compile(pattern);
  13. Matcher m = r.matcher(unescapedStr);
  14. if (m.find()) {
  15. System.out.println(m.group(1));
  16. }
  17. }
  18. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Invalid payment email provided