OK I see your point - there always needs to be a mechanism to control backtracking. And I have to confess some bias over that approach. At some point I started to favour designing lexers and parsers over trying to make the regex engine do too much for me. Not sure why other than the idea of being able to test atoms of code rather than send multiple atoms to something I can't easily test at the atomic level. However, 'horses for courses', although I think it remains true that although simplified use of regex might be slower on execution than getting the most out of the regex engine, there is one distinct advantages to my own approach: simpler regexes are more maintainable and parsers do need to be maintained. Often it is easier to explain theory using an extreme example: imagine the task is to read in any XML that might be thrown at you and convert it into a tree in Perl (CPAN not allowed). Programmer A is committed to making the regex engine do as much work as possible in designing this parser. Programmer B is the opposite, believing in lexers and parsers in pure perl with minimal use of regex. Who will produce the best results in reasonable time? Be honest!

One world, one people


In reply to Re^3: about style: use possessive or atomic? by anonymized user 468275
in thread about style: use possessive or atomic? by rsFalse

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.