I have a string that has two single quotes in it, the \' character. In between the single quotes is the data I want.
\'
How can I write a regex to extract
There's a simple one-liner for this:
String target = myData.replaceAll("[^']*(?:'(.*?)')?.*", "$1");
By making the matching group optional, this also caters for quotes not being found by returning a blank in that case.
See live demo.