多行正则表达式搜索和替换! [英] Multiline Regular Expression search and replace!

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

问题描述

我撞墙了.有没有人知道一个好的文本编辑器,它具有像 Notepad++ 这样的搜索和替换功能,但也可以进行多行正则表达式搜索和替换?基本上,我试图找到可以匹配正则表达式的东西,例如:

搜索oldlog\(.*\n\s+([\r\n.]*)\);
替换newlog\(\1\)

有什么想法吗?

解决方案

我个人的推荐是 IDM Computing 的 UltraEdit (
(来源:ultraedit.com)

I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like:

search oldlog\(.*\n\s+([\r\n.]*)\);
replace newlog\(\1\)

Any ideas?

解决方案

My personal recommendation is IDM Computing's UltraEdit (www.ultraedit.com) - it can do regular expressions (both search and replace) with Perl, Unix and UltraEdit syntax. Multi-line matching is one of the capabilities in Perl regex mode in it.

It also has other nice search capabilities (e.g search in specific character column range, search in multiple files, search history, search favorites, etc...)


(source: ultraedit.com)

这篇关于多行正则表达式搜索和替换!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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