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

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

Query replace regex with 2 alternatives


From: Dan Espen
Subject: Query replace regex with 2 alternatives
Date: Fri, 07 Dec 2012 11:51:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

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


reply via email to

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