我想请问一下以下内容用JAVA正则表达式提取<br /> 之间的字符串的如何写?
</i><br/>ShaikSahilBabu,ArnabRaha,UtpalBiswas,MrinalKantiNaskar<br/><divclass=>...
</i><br />Shaik Sahil Babu, Arnab Raha, Utpal Biswas, Mrinal Kanti Naskar<br /><div class=>
展开
1个回答
展开全部
try {
Pattern regex = Pattern.compile("<br />(.*?)<br />");
Matcher regexMatcher = regex.matcher(subjectString);
if (regexMatcher.find()) {
ResultString = regexMatcher.group(1);
}
} catch (PatternSyntaxException ex) {
// Syntax error in the regular expression
}
subjectString是你的字符串
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询