Yes, \s covers newlines as well as other whitespace. That part of the code works for my needs. The part that I do not know how to do is getting the whole original P element replaced by multiple new P elements. Perhaps I should write a more focused example.