fork(1) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4.  
  5. class rTest {
  6. public static void main (String[] args) {
  7.  
  8. String mydata2 = "some string with 'the data i want1' inside 'the data i want2'";
  9. Pattern pattern2 = Pattern.compile("'(.*?)'");
  10. Matcher matcher2 = pattern2.matcher(mydata2);
  11.  
  12. while (matcher2.find()) {
  13. System.out.println(matcher2.group(1));
  14. }
  15.  
  16. }
  17. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
the data i want1
the data i want2