取一个在线编辑器送来的html内容中的图片地址,正则如下,通过正则检测工具检查,可以取出图片的地址,但在Resin中却报错,百思不得其解,望明白的指点一下。
String content = request.getParameter( "content ");
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ", Pattern.CASE_INSENSITIVE );
Matcher mat =pat.matcher(content);
while(mat.find())
{
out.print(mat.group()+ " <br> ");
}
报错代码如下:
500 Servlet Exception
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",
Pattern.CASE_INSENSITIVE );
^
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",
Pattern.CASE_INSENSITIVE );
^
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",
Pattern.CASE_INSENSITIVE );
^
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",
Pattern.CASE_INSENSITIVE );
^
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",
Pattern.CASE_INSENSITIVE );
^
/TestFCKeditor/show.jsp:35: ^?IW&
Pattern pat = Pattern.compile( "http:\/\/(\w+\.)+(net|com|cn|org|cc|tv)(\S*\/)(\S)+\.(gif|jpg|png|bmp) ",