[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using re-builder

From: Michael Slass
Subject: Re: Using re-builder
Date: Fri, 18 Jun 2004 17:08:56 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Kevin Rodgers <address@hidden> writes:

>Phil_C wrote:
> > Thanks, that just about does it - except the beginning and ending
> > quotes are still there. Still, that's much better than it was before,
> > since now I don't have to go through the whole regex deleting "\"s.

That's really strange --- I'm not getting the quotes; in fact, I first
tried (buffer-substring (1+ (point-min)) (1- (point-max))) thinking it
would trim the quotes, and I lost the first and last chars of the RE.


>Well, you could either replace "\\`\"" and "\"\\'" with "", or avoid
>inserting them in the first place:
>(let ((regexp (reb-target-binding reb-regexp)))
>   (insert (substring regexp 1 (1- (length regexp)))))
>Another approach would be to leave the regexp string in the kill ring,
>but define a new command to yank the regexp itself into the minibuffer.

That's a great idea, but I think it would require a global keybinding
to that new command to be really useful, since you never know where
you're going to want to yank the RE.

>And instead of using replace-string to replace "\\\\" with "\\", you
>might be able to get the lisp reader to do it for you (e.g. with

Alas, that's deeper in the lisp pool than I can swim.

Mike Slass

reply via email to

[Prev in Thread] Current Thread [Next in Thread]