unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Query replace regex with 2 alternatives
@ 2012-12-07 16:51 Dan Espen
  2012-12-07 18:59 ` Barry Margolin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dan Espen @ 2012-12-07 16:51 UTC (permalink / raw)
  To: help-gnu-emacs


Could use some help on query/replace/regex.

I have an html file full of < and >.
I want to replace only some of the pairs with "[" and "]".

I figured out the match string:

"\\(<\\|>\\)

(typed as)

"\(<\|>\)

but when it comes to the replacement, I'm not clear on how to say,
first match gets [ and second match gets ].
I believe emacs can do it but I don't see it documented.
I see references to \1 \2 but not in the replace string.

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-12-08 23:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 16:51 Query replace regex with 2 alternatives Dan Espen
2012-12-07 18:59 ` Barry Margolin
2012-12-07 20:06   ` Dan Espen
2012-12-07 20:19     ` Tassilo Horn
     [not found]     ` <mailman.14801.1354911562.855.help-gnu-emacs@gnu.org>
2012-12-07 21:32       ` Dan Espen
2012-12-08  5:31     ` Barry Margolin
2012-12-07 20:11 ` Jambunathan K
     [not found] ` <mailman.14799.1354910918.855.help-gnu-emacs@gnu.org>
2012-12-08 22:07   ` WJ
2012-12-08 23:03     ` William Gardella

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).