notepad++ 使用技巧
notepad++ 替换空行 Remove empty lines and spaces in Notepad++?
回答1
To get rid of leading space(s) and all empty lines (even if the empty line contains spaces or tabs)
- Go to Search -> Replace
- Select "Regular expression" under Search mode.
- Use
^\s*
for "Find what" and leave "Replace with" blank. - Click Replace all
Regex explanation:
^
means beginning of the line\s*
means any number (even 0) of whitespace characters. Whitespace characters include tab, space, newline, and carriage return.
回答2,
用菜单里面自带的功能
Edit -> Line Operations -> Remove Empty Lines or alternatively: Edit -> Line Operations -> Remove Empty Lines (Containing Blank characters)
Cache Unsaved Docs
https://notepad-plus-plus.org/community/topic/14730/cache-unsaved-docs
https://stackoverflow.com/questions/29617349/notepad-cached-files-location
To get this behavior, you need to have the following two checkboxes TICKED :
- Remember current session for next launch
- Enable session snapshot and periodic backup
in Settings (menu) -> Preferences… -> Backup (box on left) -> Session snapshot and periodic backup (box in middle/top)
使用通配符进行搜索
https://superuser.com/questions/637476/using-wildcard-search-replace-in-notepad
Sorry folks, I just find other answers complicated. (No disrespect intended towards the original posters.)
As this always shows up as the first search result, I'll add this in:
- Open the search/replace dialog (CTRL+F then the replace tab)
- Tick "Regular Expression" down the bottom
- Use .* as the wildcard
For example, I wanted to remove all instances of abp="1314", abp="1313", abp="1312" etc (basically the numbers are all different, which is why you want a wildcard to get rid of them).
In the replace dialog:
Find in what: abp=".*"
Replace with:
(You're replacing anything within those quotes with nothing to get rid of it)
Source: https://www.organicweb.com.au/17226/general-technology/notepad-wildcard/
23:45:35|Info|Player.Play >> [Player] id=77, cardId=TB_BaconShop_HERO_53, cardName=Ysera, zonePos=0,Info={turn=0, mark=Created, created=true, originalZone=HAND, OriginalController=2, latestCardId=TB_BaconShop_HERO_53}
选中起始行和结束行之间的内容
- Press
Ctrl + G
, type the start line and hitEnter
to go to the start line. - Then go to the menu, click on
Edit
and thenBegin/End select
. - Press again
Ctrl + G
, and type the end line number and hitEnter
to go to it. - Back to the menu, click on
Edit
and thenBegin/End select
once more.
By now you will have your range of lines selected.
一次搜索两行数据
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2017-01-09 JavaScript常用的api
2015-01-09 处理和引发事件的规范