开发者

How to remove an entire line which matches a pattern

The following pattern matches an entire line, how do I search and remove these lines. If I leave a space in the replace string, it leaves a blank in that particular line, when I do via eclipse.

^[\t ]*<param name="l开发者_Go百科ogic" .*$


I don't know anything about eclipse but you may need to include the \n newline match in order to remove the line completely. Also - is it possible to replace with an empty string as opposed to a space?

^[\t ]*<param name="logic" .*\n$


To delete the line, you must also remove the line-break, not only the contents of the line. So your Expression should end with \r\n instead of $. Can't try it at the moment, so you will have to experiment yourself for the correct syntax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜