Hi Beth,

just some short answers, let me list some advantages in comparison to your method:

  • the matches in the string are highlighted (see screenshot)
  • you get an immediate update while you type and change the regex or text
  • you can manage larger (then one line) texts easier than from command prompt.
  • you can use all emacs commands/macros on the windows, especially undo and redo to get back and forward in your change history.

    Furthermore, from a emacs perspective, the elisp-code is _very_ short and simple, facilitating personal changes in just this module.

    (For instance I would like to run a command to take a snapshot of the three windows, and to append it persistently to my tests. And vice versa I would like to select just one of these tests again to continue interactive testing. One doesn't need deep knowledge of elisp to do this, since one can simply pipe any window's text in and out a perl-script to transform it.)

    Did you ever think (or try) to change the code in cperl-mode.el? It's a huge monolithic block of over 4000 lines, unfortunately it's not broken up into smaller modules... it's very hard to realize changes which will survive the next update.

    Of course your technique or the other mentioned in Composing regular expressions at runtime give experienced coders deeper testing possibilities for complicated code ... but if one is either new or in "brainless-mode" and doesn't want to code a loop it's a very good start. Talking about shell-support, you might wanna give sepia a try, it's full perl REPL integrated into emacs, of course with history functions.

    Furthermore it should be possible to tweak the perldebugger into a regex-tester with history cache, one can add aliases for personal commands and the docs mention pre and post commands to run with each prompt. (anyway I couldn't make the latter work using commands like <,> and { ...???)

    Cheers Rolf

    UPDATE: just found a note that it doesn't work with Xemacs :-( Sadly these incompatibilities are the main reason why I switched to Gnu Emacs a year ago, while I still recommend xemacs for newbies.


    In reply to Re^2: [emacs] short review of regex-tool.el by LanX
    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.