标签:blog java ar div html line log htm
public static void main(String[] args) { String regex = "<\\s*img(.+?)src=[\"‘](.*?)[\"‘]\\s*/?\\s*>"; Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); String content = "<img width=\"450\" height=\"610\" alt=\"\" src=\"/data/attachment/editor/201307040924448645.jpg\" />"; Matcher matcher = pattern.matcher(content); while (matcher.find()) { String group0 = matcher.group(0); String group1 = matcher.group(2);
System.out.println(group0);
System.out.println(group2);
} }
匹配html img 标签的正则表达式 java,布布扣,bubuko.com
标签:blog java ar div html line log htm
原文地址:http://www.cnblogs.com/suyuji/p/3910475.html