使用记事本++在正则表达式中查找行尾 [英] Find end of the line in regular expression using notepad++

查看:97
本文介绍了使用记事本++在正则表达式中查找行尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Notepad ++,我想找到新行(在连字符,可选空格和最后一行中的某些字符之后). 我想出了这样的东西:

I am working with Notepad++ and I would like to find the new line (after the hyphen, optional space and some characters in the end line). I have came up with something like this :

  • -[ ]?.*\n

我也尝试过:

  • -[ ]?.*(\n)
  • -[ ]?.*(\r\n)
  • -[ ]?.*[\r\n]
  • -[ ]?.*[\n]
  • -[ ]?.*(\n)
  • -[ ]?.*(\r\n)
  • -[ ]?.*[\r\n]
  • -[ ]?.*[\n]

这些都不起作用. 如果有问题,我正在Windows上工作.

None of these worked. I am working on Windows if it matters.

推荐答案

您是否真的需要 match 换行符?如果没有,您可以简单地使用$作为行尾的锚点.

Do you actually need to match the line break? If not, you can simply use $ which is the anchor for end of a line.

这篇关于使用记事本++在正则表达式中查找行尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆