import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "title=\".*(title=\"(.*.)\">)";
final String string = "<div id=\"video_6003150\" class=\"thumb-block\"><div class=\"thumb-inside\"><div class=\"thumb\"><a href=\"/video6003150/pure_mature_janet_mason\"><img src=\"https://cdn77-pic.xvideos-cdn.com/videos/thumbs169l/03/4b/22/034b224b0f77b7260aa8d6c44b49cb69/034b224b0f77b7260aa8d6c44b49cb69.5.jpg\" data-idcdn=\"10\" data-videoid=\"6003150\" id=\"pic_6003150\"><div class=\"videopv\" style=\"display: none;\"><a href=\"https://www.xvideos.com/video6003150/pure_mature_janet_mason\"></a><div class=\"progress\" style=\"display: none;\"><div class=\"bar\" style=\"width: 100%;\"></div></div></div></a></div><button class=\"watch-later init-ok\" title=\"Ver después\"><span class=\"icon-f icf-clock\"></span></button><a class=\"icon-f icf-check-circle icf-white-fill prof-verified-tick\" title=\"Modelo verificada\" href=\"/verified/videos\"></a></div><div class=\"thumb-under\"><p><a href=\"/video6003150/pure_mature_janet_mason\" title=\"Pure Mature Janet Mason\">Pure Mature Janet Mason</a></p><p class=\"metadata\"><span class=\"bg\"><span class=\"duration\">7 min</span><a href=\"/channels/puremature\"><span class=\"name\">Pure Mature</span></a><span><span class=\"sprfluous\"> - </span> 9,7M <span class=\"sprfluous\">Vistas</span></span><span class=\"sprfluous\"> - </span></span></p></div></div>";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html