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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |