unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: biff314@yahoo.com (Phil_C)
Subject: Re: Using re-builder
Date: 18 Jun 2004 07:35:43 -0700	[thread overview]
Message-ID: <316044c2.0406180635.4b91e594@posting.google.com> (raw)
In-Reply-To: m3n031ol2b.fsf@eric.rossnet.com

Michael Slass <miknrene@drizzle.com> wrote in message news:<m3n031ol2b.fsf@eric.rossnet.com>...
> biff314@yahoo.com (Phil_C) writes:
> 
> >When I copy a regex to the kill ring and then try to use it in
> >something like "Query replace regex", I have to delete the extra "'s
> >and \'s before it will work. Is there a way to copy it from re-builder
> >without having to do that?
> 
> 
> Try this:
> 
> (defun reb-copy-unquoted ()
>   "Copy current RE into the kill ring for later insertion as unquoted."
>   (interactive)
>   (reb-update-regexp)
>   (let ((re (with-temp-buffer
> 	      (insert (reb-target-binding reb-regexp))
>               (replace-string "\\\\" "\\" nil (point-min) (point-max))
>               (buffer-substring (point-min) (point-max)))))
>     (kill-new re)
>     (message "Regexp copied to kill-ring")))

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.


Thanks again,

--Phil

  reply	other threads:[~2004-06-18 14:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-17 17:45 Using re-builder Phil_C
2004-06-17 22:51 ` Michael Slass
2004-06-18 14:35   ` Phil_C [this message]
2004-06-18 16:05     ` Kevin Rodgers
2004-06-18 17:08       ` Michael Slass
2004-06-18 18:54         ` Kevin Rodgers
2004-06-18 20:09           ` Michael Slass
2004-06-18  9:03 ` martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=316044c2.0406180635.4b91e594@posting.google.com \
    --to=biff314@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).