<b>You selected:</b>
Nokia 7500 Prism Black
<br>
不能是这样<b>(.*)</b>([^\\<]+)\\<,我需要这个表达式能识别换行或者是回车,并且要能完全识别出<br>.
Nokia 7500 Prism Black
<br>
不能是这样<b>(.*)</b>([^\\<]+)\\<,我需要这个表达式能识别换行或者是回车,并且要能完全识别出<br>.
调试欢乐多
这样试试
String str="<b>You selected:</b>\r\nNokia 7500 Prism Black\r\n<br>";
Matcher m = p.matcher(str);
if(m.matches()){
System.out.println(m.group());
}
执行时间:1652毫秒(1.652秒) 占总时间61.55%★表达式2:^<(b)>.+?</\1>.*?<br>$
执行时间:1032毫秒(1.032秒) 占总时间38.45%believefym(feng)的方法效率更高一些