Hello monks,
i want to close </book-part> tag before the next chapter tag beginning
e.g
<book-part book-part-type="chapter" book-part-number="\d+" id="chapter\d+">its a beginning tag of each chapter.
"</book-part>" should close before next chapter's opening tag,(i.e)</book-part> is an ending tag of each chapter
plz give some suggestion, thank u monks
i try below code but i does't show any changes
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>"; }
my output generate in below
</book-part> <book-part book-part-type="chapter" book-part-number="2" id="chapter2" +>
"</book-part>" this is first chapter's closing and "<book-part book-part-type="chapter" book-part-number="2" id="chapter2">" this is second chapter opening
In reply to XML tag closing by maha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |