I personally believe that you're actually getting quite repetitive: the fact that you have admittedly "too small a knowledge" but nevertheless think that "there should be a regex solution" is in conflict with the fact that virtually everybody who is knowledgeable knows that they're poor enough for HTML parsing. And if it's not strictly to do only with HTML parsing, but is of comparable complexity, then they are still just as poor and a good enough solution may be given in terms of code comprising e.g. several regexen and other logic. Point is, regexen are powerful, and have been capable of matching stuff that is far from being "regular" for a long time, but there's some common stuff which in turn is still too irregular for them. It is my understanding that Perl 6's rules will be powerful enough to parse HTML (and some other cool things the most famous of which is Perl 6 itself!) Then they should be able to parse your other thingy, whatever it is. What's more, they will be able to do so in a very clear and readable manner, organized in grammars. Up to then, if really wanting to, you may indeed be able to have at your hands some fraction of their power in Perl 5's regexen, which may be enough or not, depending on the actual situation. But in your real world case, I suspect the solution would come out either severely unreliable or horribly looking, with various intermediate degrees between such extremes.

--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to Re^4: regex: something...(!something)...something by blazar
in thread regex: something...(!something)...something by aaaone

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.