I've got an archive of scripts, and I'd like to be able to mark them up in some way, for searching, so that they distinguish between, say, stage directions and speech, or find each character's speeches -- for instance:

<stage-direction>Enter Fred, stage right</stage-direction> <speech>FRED: Hey everyone, what's up?</speech>

or maybe

<stage-direction>Enter Fred, stage right</stage-direction> <speech character="Fred">Hey everyone, what's up?</speech>

and I know that this goes against the "do it properly" ethos, but if I didn't want to use XML, has anybody got any suggestions for an XML-like custom markup which makes flat text files easy to search?

It doesn't have to be case-insensitive or even whitespace-independent, say if it was just:

begin-stage-direction Enter Fred, stage right end-stage-direction

That would be cool. Then it can just be read with some regex/for-loop thing like:

if(/^begin-stage-direction/){ $notice_next_line = 1; }else{ next; }
kind of construct.

I know there's a big "why not do it properly in a database" hanging over this, but assuming text files with custom markup, is there a non-stupid way to do this?
--

($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

In reply to Poor Man's XML? by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.