fork(162) download
  1. class Ideone {
  2. public static void main (String[] args){
  3. String[] tests = {"some string with 'the data i want' inside", "foo bar"};
  4. for (String myData : tests) {
  5. String target = myData.replaceAll("[^']*(?:'(.*?)')?.*", "$1");
  6. System.out.println( myData + " --> " + target);
  7. }
  8. }
  9. }
  10.  
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
some string with 'the data i want' inside --> the data i want
foo bar -->