Speaking of test, here's some code I wrote to do basic testing
use Test::Simple tests => 7; sub cpi { # the converter goes here } $a = '>> no snake here >>> or here I agree'; $b = '>> and neither should this >>> be understood snakily >>> because it is a nested quote >> yes I know it is not really named after a snake '; $c = '>> >>>no snake >>>no snake '; $d= '>>> still no snake seen >> right! '; $snakea = '>>> i = j '; $snakeb = '>>> i = j + 1 >>> q is good code'; $snakec = '>> does this work right? lets see: >>> i = test(func) '; ok (cpi($a) eq $a); ok (cpi($b) eq $b); ok (cpi($c) eq $c); ok (cpi($d) eq $d); ok (cpi($snakea) eq 'PYTHON_PROMPT_PROTECTED i = j '); ok (cpi($snakeb) eq 'PYTHON_PROMPT_PROTECTED i = j + 1 PYTHON_PROMPT_PROTECTED q is good code'); ok(cpi($snakec) eq '>> does this work right? lets see: PYTHON_PROMPT_PROTECTED i = test(func) ');

In reply to Re^3: Using a regex to catch interpreters by eastcoastcoder
in thread Using a regex to catch interpreters by eastcoastcoder

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.