如何将括号内的文本复制到行首?

How to copy text within parentheses to the start of the line?

我想知道执行此操作的表达式超过 1000 行。

之前:

Insurgent (2015)
The Lazarus Effect (2015)
Cinderella (2015)
Platoon Leader (1988)
The Gunman (2015)
Woman in Gold (2015)

之后:

2015 - Insurgent
2015 - The Lazarus Effect
2015 - Cinderella
1988 - Platoon Leader
2015 - The Gunman
2015 - Woman in Gold

我知道怎么做

但是我不知道

的表达方式

非常感谢您的帮助。

在 find/replace 对话框中,确保选中正则表达式框。然后搜索:

^(.+?)\s+\((\d+)\)$

并替换为:

 - 

使用正则表达式来做到这一点。

打开替换框 (CTRL+h),选中替换框底部的 Regular Expression 单选框。

然后在 Find what 字段中输入:(.+)\((\d+)\)

Replace with 字段中输入: -

然后点击全部替换按钮