如何在 emacs 中执行等效的正则表达式搜索操作,如 vim?

How can I perform the equivalent regex searching operation in emacs like vim?

我有一个文件,其中包含如下内容:

hello1
hello2
hello3
haha1
haha2
haha3

注意有一些正则表达式模式 hello\d。 在 vim 中,我可以通过键入 /hello\d 执行查找操作,然后在不同匹配项之间键入 nN 以查看我的代码。

我想知道如何在 Emacs 中执行相同的操作。 C-rC-s 不会完成这项工作,因为有一个正则表达式模式,但如果我使用 query-replace-regexp,我无法通过 C-r 或 [=17 遍历每个匹配项=].如果原始 Emacs 设置不是不可能的?我怎么能在 Emacs 中做我在 vim 中做的同样的事情?

使用isearch-forward-regexp,默认绑定到C-M-s。 (同样,isearch-backward-regexp 绑定到 C-M-r。)

从那里您可以使用 C-sC-r 照常浏览结果。