在 Atom 编辑器中用 RegEx 组件搜索和替换

我想找到并替换这个

`https://example.com/`{.uri}

[https://example.com/](https://example.com/)

vim我会做一个 s/(http. *) {.uri}/[\1](\1)/g,但这不与 atom.io工作。我该如何解决这个问题?

101833 次浏览

如果您 Cmd-F 并打开搜索窗格,有一个“。右边的按钮 * 。单击它,现在是正则表达式模式。

我发现

(http.*)\{\.uri\}

并更换到

[$1]($1)

如果你在搜索视图中没有找到正则表达式模式,为了将来的读者更新 @ Speedogoo 的回答,它看起来是这样的:

enter image description here

你也可以用快捷键 Ctrl + Alt + / (默认)打开它。


请注意,甚至 ^$ 已经被支持了也是由 Atom 的 find-and-place 完成的。