in reply to Poor Man's XML?
The content after each tag is delimited by the next tag or the EOF. You could decompose this format into its respective parts using, e.g.,<stage right> Enter Juliet <speech Juliet> Romeo! Romeo! Where the heck are you! <audience> claps.
-Markwhile (<>) { if (/^<(.+?)>(.*)$/i) { $tag = $1; $part{$tag} .= $2; } else { $part{$tag} .= $_; } }
|
|---|