假設我有一個很好的想法,使html鏈接標記解析器爲了探索互聯網,我使用正則表達式來解析和捕獲頁面中每一個鏈接的出現。此代碼目前正常工作,但我正在尋求添加一些成員以反映「操作狀態」。 public class LinkScanner {
private static final Pattern hrefPattern = Pattern.compile("<a\\b[^>]*href=\
我有多個捕獲基團的正則表達式: String text = "one two uno third second tres";
Matcher matcher = Pattern.compile(regex).matcher(text);
for(int index = 0; matcher.find(index); index = matcher.end()) {
System.ou