Shalom, monks. I'm working on XML::Validator::Schema and I've become convinced that I need to use the regular expression engine to check XML Schema content models.
I wonder why you are convinced you'd need regular expressions to do so. While it might be possible to do so with regular expressions, and, if I were into XML, I might do it with regular expressions just for the hack of it, I wouldn't use it for anything serious.

Checking XML schema just screams "parse me, parse me". And if the application is serious, that is, your schemas are large, you have lots of them, and time is important, you wouldn't use a recursive decent parser, but a parser that's fast (limited lookahead).

Having said that, I've posted here regular expressions to solve the 8 queens problem, and to find Hamiltonian paths in graphs. (I don't have the links). And on Dominus site (perl.plover.com, IIRC) there's an explanation of a regex I made that solves 3-SAT, proving that deciding whether regular expressions (even with (?{ }) and (??{ }) constructs) match, is NP-complete.

Abigail


In reply to Re: Abusing Regular Expressions by Abigail-II
in thread Abusing Regular Expressions by samtregar

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.