Question - How to extract a substring using regex ?
Answer -
Example - String test = "This is a test String and 'This is data we want'"
A:
String data = "This is a test String and 'This is data we want'";
Pattern pattern = Pattern.compile("'(.*?)'");
Matcher matcher = pattern.matcher(data);
if (matcher.find())
{
System.out.println(matcher.group(1));
}