If I understand your question and data correctly, you may make that work well ... so long as you're very sure there won't be <hr /> inside something you wish to capture ... and, given that precondition, that you're very careful about the greediness (or non-greediness, in this case) of your regex.