help-gnu-emacs
[Top][All Lists]
Advanced

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

I can't yank regexp for/into isearch-forward-regexp's pmpt


From: David Combs
Subject: I can't yank regexp for/into isearch-forward-regexp's pmpt
Date: 2 Aug 2006 23:40:06 -0400

Subject: I can't yank regexp for/into isearch-forward-regexp's pmpt

[  ESC C-s runs the command isearch-forward-regexp  ]

My problem:


Doing isearch-forward-regexp against the line (note the "x"):

     "aaa  aaaa   aaaaaaaa   aaaaa   aaaaax    aa"

  , via the regexp "x", works fine -- and does so REGARDLESS
  of whether the regexp is:

    (a) typed-in the "x" by hand or
    (b) *META*-YANKED-in (ie via "M-y" -- not a plain "y").

However, when yanked-in, none of *these* (for trying to match
FIVE "a's") will match that *same* 
"aaaaaa aaa..." string (at least not for me!):

---- candidate regexps to try with C-y and/or M-y:

1: "a{5}"
2: "a\{5\}"      <<--- works fine IF prompt answered TYPED-IN BY HAND.
3: "a\\{5\\}"
4: "a\\\{5\\\}"

But *none* of the four work (for me) via yank, ie regionize
the regexp, grab it via M-w, put POINT somewhere before that
"aaaaa"-string, and then, as above, do the M-C-s 
(ie isearch-forward-regexp), and respond to its prompt
with M-y.

(Well, it does match, but not that "aaaaaa..."-line,
but rather the very one of the four trial-regexps
I had just grabbed -- as if it were a straight
*non*-regexp search!)


[ But note: the grab-regexp then yank back as prompt-response works
  JUST FINE, not with issearch-whatever, but with M-x OCCUR, 
  and for it's prompt, all it needs is just a PLAIN "C-y"! ]

Please, guys, what's up?


All I want to do is to be able to save into a file some regexps I find useful,
and then be able to use them merely by grabbing one via M-w, and then
answer the prompt by merely yanking or even meta-yanking it into or as
the prompt-response.


Please, what am I doing wrong?

Thanks!


Is there any good way to *explain* it in some tutorial-way that I (or any
user) a rule or technique for doing this with *any* regexp-prompting-for
command, eg that will work equally for *both*:

    M-x occur

    isearch-forward-regexp

    isearch-forward

    M-x query-replace-regexp

    etc, etc


 AND also, what rules for back-slashing a regexp as needed
     for *any* of the above.

Thanks again,

David





reply via email to

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