使用正则表达式在 Notepad++ 中查找和替换 [英] Find and Replace in Notepad++ using Regular Expression

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

问题描述

我得到了一个数字列表.每行一个号码.我想用特定模式替换所有数字.例如,我的文件如下所示:

I got a numeric list. One number per line. I want to replace all numbers with a specific pattern. For example, my file look like this:

1
2
3
4

我想使用 Notepad++ 中的正则表达式将其替换为如下所示:

I want to replace it so as to look like the following using a regexp in Notepad++:

[1],
[2],
[3],
....

推荐答案

查找内容:

([0-9]+)

替换为:

[\1],

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

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