Como faço facilmente um comando de substituição que NÃO altera a letra?
I am thinking something like
. [A-z]
but that actually replaces[A-z]
with the matched letter.
Você precisa usar a expressão ()
(Grouping), junto com a expressão \
(Placeholder).
Algo como o seguinte.
Pesquisar por:
. ([A-z])
Substitua por:
.
()
Round brackets have no effect on the search pattern, but are used to divide the pattern into logical sequences where you wish to re-assemble those sequences in a different order during the replace – or to replace only part of that sequence. They must be used in pairs and are addressed by number in the replacement e.g.
(John) (Smith)
replaced by(note the spaces in the search and replace strings) – will produce
Smith John
or replaced by
alone will give
Smith
.Note: The placeholders
,
etc., can also be used in the search string to identify recurring text. e.g.
Fred Fred could be written
(Fred)
.Round brackets are perhaps the most useful aspect of complex wildcard search and replace operations.