Notepad++ 记事本++;将结束文本移动到行的开头

Notepad++ 记事本++;将结束文本移动到行的开头,notepad++,Notepad++,我有一行文字,看起来像这样: Arnold Sweet - A+ Ashley C. D. - B+ Steve Crook Dewl - A- Tanya A - Absence w/e 还有更多 如何将所有行转换为: A+ - Arnold Sweet B+ - Ashley C. D. A- - Steve Crook Dewl Absence w/e - Tanya A tnx Ctrl+H 查找内容:^(+?)-(++?)$ 替换为:$2-$1 检查环绕 检查正则表达式 不要选中。

我有一行文字,看起来像这样:

Arnold Sweet - A+
Ashley C. D. - B+
Steve Crook Dewl - A-
Tanya A - Absence w/e
还有更多

如何将所有行转换为:

A+ - Arnold Sweet
B+ - Ashley C. D.
A- - Steve Crook Dewl
Absence w/e - Tanya A
tnx

  • Ctrl+H
  • 查找内容:
    ^(+?)-(++?)$
  • 替换为:
    $2-$1
  • 检查环绕
  • 检查正则表达式
  • 不要选中
    。匹配换行符
  • 全部替换
说明:

^       : begining of line
(.+?)   : group 1, 1 or more any character, not greedy
 -      : literally a space, a dash, a space
(.+?)   : group 2, 1 or more any character, not greedy
$       : end of line

的作用是什么?@bolov:这是非贪婪量词,请看:谢谢。我知道我可以用它几次:p@dave:对你有用吗?如果是,请随时将答案标记为已接受,请参阅: