简体   繁体   English

"删除记事本++中的数字"

[英]Remove Numbers in Notepad++

I have here a text file with我这里有一个文本文件

245. asdasd
45. asdasd
42. gfhfgh
5353. sdfsdf

Ctrl+F - Replace - Search mode: regular expression Ctrl + F - 替换 - 搜索模式:正则表达式

Find What: [0-9]+ 找到什么:[0-9] +

Replace With: 用。。。来代替:

// Replace with is empty //替换为空

Ctrl-H - shows replace. Ctrl-H - 显示替换。

Ensure that 'regular expression' is on. 确保启用“正则表达式”。

Use ^[0-9]+ 使用^[0-9]+

Note begging ^ used to mark begin of line. 注意请求^用于标记行的开头。 Remove it if need remove all numbers 如果需要删除所有号码,请删除它

use RegEx search (should be ^\\d+ for numbers with more than 1 digit): 使用RegEx搜索(对于超过1位的数字,应该是^\\d+ ):

在此输入图像描述

To search for digits: 要搜索数字:

  1. Find what: [[:d:]] 找到:[[:d:]]
  2. Select: o Regular Expression 选择:o正则表达式

On the replace tab switch to regular expressions; 在替换选项卡上切换到正则表达式; Search for ^\\d+\\.\\s and leave Replace With empty. 搜索 ^\\d+\\.\\s并将Replace With留空。

(Matches start of line, any number, a dot, trailing space) (匹配行首,任何数字,点,尾随空格)

You should try to use this regular expression to remove what you want in the replace dialog: 您应该尝试使用此正则表达式删除替换对话框中的内容:

^[0-9]*\.\ (.*)

And replace with: 并替换为:

\1

要仅删除“带点的行号”,请使用[0-9] +。

To remove digits only from start of string 仅从字符串的开头删除数字

Input : 123. asdasd 3434
Output: . asdasd 3434

Replace All using below regex with o or more spaces in start of string 使用下面的正则表达式替换全部,在字符串的开头使用o或更多空格

^\s*\d+

在此输入图像描述

我不想创建一个新主题,也许人们也想知道这一点,但是我如何删除后面的数字,例如<option value="2014">Murder<\/option>:4855.7080078125,"x":1728.0529785156<\/code>

"

For Numbers对于数字
Ctrl H Ctrl H
Find what: [0-9]查找内容:[0-9]
Replace With:用。。。来代替:
(leave replace with blank) (留空替换)

For Period期间
Ctrl H Ctrl H
Find what: .找什么: 。
Replace With:用。。。来代替:
(leave replace with blank) (留空替换)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM