I am trying to replace two or more occurences of <br/>
(like <br/><br/><br/>
) tags together with two <br/><br/>
with the following pattern
Pattern brTagPattern = Pattern.compile("(<\\s*br\\s*/\\s*>\\s*){2,}",
Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
But there are some cases where '<br/> <br/>
' tags come with a space and they get replaced with 4 <br/>
tags which was actually supposed to be replaced with just 2 tags.
What can i do to ignore 2 or 3(few) spaces that come in between the tags ?