2012-05-21 47 views

回答

4

要匹配href属性值可以使用下面的方法:

final Pattern pattern = Pattern.compile("href=\"(.*+)\""); 
Matcher matcher = pattern.matcher(html); 
String link = null; 
while (matcher.find()) 
{ 
    link = matcher.group(1); 
    Log.i("my.regex", "Found link: " + link); 
} 
+0

@Neeraj,我不知道你的意思是... mailto是一个特殊的锚定属性。你打算如何在这里使用它? – rekaszeru