我正在寻找一个RegEx来匹配从网页来源的链接。如果你有任何代码样本,它将是有用的。
谢谢
发布于 2012-05-22 02:46:08
要匹配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);
}https://stackoverflow.com/questions/10690695
复制相似问题