I'm making a template system for my news poster, with some special tags. Everything between {if!comments}{/if!comments} should for example be showed when we're not on a comment page, but not when we are. Therefore I have to remove it from the template when comments are showed. I use
The regex seems to be fine. When does it NOT remove them? Do the comments ever contain newline characters? If so, your regex isn't accounting for that.