日期:2014-05-20  浏览次数:20668 次

要提取这串内容的连接怎么有问题?
<a href="http://www.92mp3.com/lrc/lrc.asp?ac=down&id=17656&gq=晴天" target=_blank>LRC歌词来自:http://www.92mp3.com/lrc/lrc.asp?ac=down&id=17656&gq=晴天</a>

正则表达式为:"(?<=<a href=\").*?(?=\"\\s*>LRC歌词</a>)"
哪里错了?

------解决方案--------------------
Java code
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test 
{
 
 public static void main(String[] args)
 {
         String s="<a href=\"http://www.92mp3.com/lrc/lrc.asp?ac=down&id=17656&gq=晴天\" target=_blank>LRC歌词来自:http://www.92mp3.com/lrc/lrc.asp?ac=down&id=17656&gq=晴天  </a>";  
        String regex="LRC歌词来自:http://.*?</a>";
        Matcher mt=Pattern.compile(regex).matcher(s);
        while(mt.find())
        {
             String LRCurl=mt.group().replaceAll("LRC歌词来自:|</a>","");
            
             System.out.println("您需要的网址为:"+LRCurl);
             
        }
 }
 
}