atom - 如何在 Atom 中替换而不替换搜索的某些部分?

atom - How to replace in Atom without replacing some part of the search?

假设我在一个文件中有这些行:

This and an child
That and a entrepreneur
These and a banana
This and an cookie

我想替换所有不正确的 ana
我可以使用 an [^aeiou]a ^[aeiou] 找到所有不正确的地方(我想,我不擅长正则表达式)。
我想要的是使用这些表达式替换不正确的而不更改 a/an 之后的字母。 我该怎么做?

您需要使用 capturing group, (...), 然后将其包含在替换中


搜索:

an ([^aeiou])
a ([aeiou])

替换:

a 
an