Multiline Regular Expression search and replace!

2019-01-18 08:34发布

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?

14条回答
走好不送
2楼-- · 2019-01-18 09:40

I use Eclipse, which is free and that you may already have if you are a developer. '\R' acts as platform independent line delimiter. Here is an example of multi-line search:

search:

\bibitem.(\R.)?\R?{([^{])}$\R^([^\].[^}]$\R.$\R.)

and replace:

\defcitealias{$2}{$3}

查看更多
混吃等死
3楼-- · 2019-01-18 09:41

You could use Visual Studio. Download Express for free if you don't have a copy.

VS's regex is non-standard, so you'd have to use \n:b+[\r\n] instead.

查看更多
登录 后发表回答