【问题标题】:regular expression to find at the end of lines在行尾查找的正则表达式
【发布时间】:2012-02-22 15:53:43
【问题描述】:

我有很多行开头如下:

text.1
text.2
othertext.21
anothertext.50
dfgtext.161

我需要的是找到只有 .1(不是 .21,不是 11),只有 anytext.1 的行

我用记事本++

谢谢,

【问题讨论】:

    标签: regex search find notepad++


    【解决方案1】:

    你只需要匹配行尾,所以试试\.1$

    【讨论】:

      【解决方案2】:

      如果是任何文本 + .1,请尝试以下正则表达式

      .+?\.1$
      

      【讨论】:

        【解决方案3】:

        假设 Notepad++ 支持$,行尾匹配,\.1$ 应该适合你。

        【讨论】:

          猜你喜欢
          • 2012-03-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-07-01
          • 1970-01-01
          • 2012-12-17
          相关资源
          最近更新 更多