class Ideone {
public static void main
(String[] args
){ String[] tests
= {"some string with 'the data i want' inside",
"foo bar"}; String target
= myData.
replaceAll("[^']*(?:'(.*?)')?.*",
"$1"); System.
out.
println( myData
+ " --> " + target
); }
}
}
Y2xhc3MgSWRlb25lIHsKcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpewogICAgU3RyaW5nW10gdGVzdHMgPSB7InNvbWUgc3RyaW5nIHdpdGggJ3RoZSBkYXRhIGkgd2FudCcgaW5zaWRlIiwgImZvbyBiYXIifTsKICAgIGZvciAoU3RyaW5nIG15RGF0YSA6IHRlc3RzKSB7CiAgICBTdHJpbmcgdGFyZ2V0ID0gbXlEYXRhLnJlcGxhY2VBbGwoIlteJ10qKD86JyguKj8pJyk/LioiLCAiJDEiKTsKU3lzdGVtLm91dC5wcmludGxuKCBteURhdGEgKyAiIC0tPiAiICsgdGFyZ2V0KTsKfQp9Cn0K