Help for this page
if($str =~ /<book-part book-part-type="chapter" id="chapter\d+">((?:(? +!<\/?book-part book-part-type="chapter" id="chapter\d+">).)*)(?=<book +-part book-part-type="chapter" id="chapter\d+">)/sgi) { $str .="<book-part>"; }
</book-part> <book-part book-part-type="chapter" book-part-number="2" id="chapter2" +>