here's a simple one
$input='Hello<br/><br/><br/><br/>';
$input = preg_replace('!(<br/>){2,}!i', '<br/>', $input);
echo $input;
it doesn't take whitespace inside the tag into account though, like the ones dfox linked to
The exclamation marks delimit the whole pattern. You can use any number of characters, most people use forward slashes. I didn't use them because the pattern itself contains a forward slash as part of the <br/>, meaning it would need to be escaped if I did.
The parentheses identify that we're looking to match <br/> as a whole. The {2,} means 'two or more times'
Lastly, the i at the end means case insensitive.