String regex = "<a.*?/a>";//取鏈接
?? ??? ?Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
?? ??? ?Matcher mt = pattern.matcher(str);
?? ??? ?while (mt.find()) {
?? ??? ?String s=mt.group();
?? ??? ?}
?? ???? String regex2 = ">.*?</a>";// 標(biāo)題部分
?? ???? String regex3 = "imgs/[([0-9])]+.(jpg|gif|png|bmp)";//取圖片
輸入例子可產(chǎn)生正則表達(dá)式
http://sourceforge.net/projects/quickrex/
在線測試
http://www.fileformat.info/tool/regex.htm
?? ??? ?Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
?? ??? ?Matcher mt = pattern.matcher(str);
?? ??? ?while (mt.find()) {
?? ??? ?String s=mt.group();
?? ??? ?}
?? ???? String regex2 = ">.*?</a>";// 標(biāo)題部分
?? ???? String regex3 = "imgs/[([0-9])]+.(jpg|gif|png|bmp)";//取圖片
輸入例子可產(chǎn)生正則表達(dá)式
http://sourceforge.net/projects/quickrex/
在線測試
http://www.fileformat.info/tool/regex.htm