Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
> especially as regards the "questionable" ones

Yes sorry.

I didn't want to over complicate the question, and just wrote .*? between the markup.

Actually I'm using now something like (\S.*?(?<=\S)) to enforce at least one non-whitespace between the markers.

The objective of the question was "How best to allow * / _ to be chained and or nested".

The recursive approach does it already pretty well.

And actually nesting these markups is of rather low priority in the to-do list

> Can you supply some test cases for variations, especially WRT intermixtures with standard HTML?

That's my project: Wikisyntax for the Monastery =)

JS-regex is mostly compatible to Perl4 regex.

these are some tests I use ATM

sub is_tf { my ($in,$out,$label) = @_; is( rec( $in ) => $out => "$label: \t'$in'\t->\t'$out'" ); } sub no_tf { my ($in,$label) = @_; is_tf($in,$in,$label); } no_tf( '**' => "no letter" ); is_tf( '*A*' => '<b>A</b>' => "one letter"); is_tf( '*A B*' ,'<b>A B</b>' , "multi word"); no_tf( '* A*' , "before non-whitespace"); no_tf( '*A *' , "after non-whitespace"); no_tf( "*A\nB*" , "line break"); is_tf( '*A *B*' ,'<b>A *B</b>' , "after non-whitespace prolonged"); is_tf( '/**/' ,'<i>**</i>' , "nested no letter");

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

In reply to Re^4: wiki regex reprocessing replacement by LanX
in thread wiki regex reprocessing replacement by LanX

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (3)
    As of 2020-09-22 02:20 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (127 votes). Check out past polls.