all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.