gpt4 book ai didi

regex - 从 Notepad++ 中的行中删除所有数字+符号

转载 作者:行者123 更新时间:2023-12-05 00:15:40 25 4
gpt4 key购买 nike

是否可以删除 Notepad++ 中的每一行不包含

a   b   c   d   e   f   g   h   i   j   k   l   m
n o p q r s t u v w x y z

A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z

, . '

像这样:

enter image description here

删除非ASCII
.*[^\x00-\x7F]+.*

删除号码
.*[0-9]+.*

文字:
example
example'
example,
example.


example123
éxample è
[example/+
example'/é,
example,*
exa'mple--
example@
example"

最佳答案

您可以使用

^(?![a-zA-Z,.']+$).+$\R?

正则表达式匹配任何不仅由 ASCII 字母组成的非空行 ( .+ ), , , .' . \R?最后匹配一个可选的换行符。

详情 :
  • ^ - 字符串开头
  • (?![a-zA-Z,.']+$) - 如果模式不匹配,则匹配失败的负前瞻:[a-zA-Z,.']+ - 1 个或多个 ASCII 字母、逗号、句点或单引号,直到行尾 ( $ )
  • .+ - 除换行符以外的 1+ 个字符
  • $ - 行尾
  • \R? - 一个可选的换行符(序列)

  • enter image description here

    关于regex - 从 Notepad++ 中的行中删除所有数字+符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44021634/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com