java regex

List<String> matchList = new ArrayList<String>();
try {
    Pattern regex = Pattern.compile("<img[\\s\\S]*?src=\"([\\s\\S]*?)\"[\\s\\S]*?>", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
    Matcher regexMatcher = regex.matcher(subjectString);
    while (regexMatcher.find()) {
        matchList.add(regexMatcher.group());
    }
} catch (PatternSyntaxException ex) {
    // Syntax error in the regular expression
}

原文地址:https://www.cnblogs.com/lexus/p/2797513.html