When I want to test a regex, I usually open up an xemacs shell buffer (or even a regular command shell) and run the following eval loop to check regular expressions: perl -ne'print eval($_) . "\n"'. Then I type in lines like

$re=qr{^abc}; 'abcdef' =~ $re; 'zabcdef' =~ $re; $x='Some long and ugly text'; $x =~ /long and ugly/; # and so on...

Doing it in a shell buffer makes it easy to cut and paste values for either the text or the regex from other code. Then when I have a regular expression that does what I want I can cut & paste it back into my code very easily as well. An eval shell a lot gives me a lot of flexibility for playing "write-a-little, test-a-little".

Yet you write with enthusiam "I like it!". Perhaps you could explain what a dedicated regex mode adds for you beyond what I just described? I'm probably too set in my ways, but I'm not seeing it.

Now, what would be nice is Perl command buffer along the lines of the e-shell. That would convert even my minimal one-liner to start the eval loop into a mindless click. I wrote something like that for myself a year or so ago, but it seems to have disappeared in one of my periodic migrations from machine to machine.

Best, beth


In reply to Re: [emacs] short review of regex-tool.el by ELISHEVA
in thread [emacs] short review of regex-tool.el by LanX

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.