Eclipse正则表达式搜索/替换不是在正则表达式之后替换正面的? [英] Eclipse regex search/replace not replacing after regex positive look-ahead?

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

问题描述

我在eclipse 3.5中做了一个积极的前瞻,我无法做任何替代!具体来说,我放入任何文本字符串来替换找到的字符串,并且无法替换文本字符串。我的积极前瞻是在行尾,以便在下一次搜索中包含正面的前瞻文字。



什么事?这也是最新的基于eclipse的Aptana Studio的一个问题。



示例:

 你好! 
我试图匹配
一些东西
-Hello!
Burbpaoiwjf
paowijefpioj
-Hello!

匹配模式:

 $?$?$?$?$?$?$?$?$?$?$?$?$? b 

这将匹配,但我无法用任何东西替换匹配的文本。

解决方案

这是一个已知错误



作为一种解决方法,将搜索模式更改为:

 (?s)-Hello!(。*?) - 你好! 

并包含

 code>你好! 

您的替换字符串。


After I do a positive lookahead in eclipse 3.5, I am unable to do any sort of replace! Specifically, I put in any text string to replace the found string, and the text string is unable to be replaced. My positive lookahead is at the end of the line so as to include the positive lookahead text in the next search.

What's up? This is also a problem in the latest Aptana Studio, which is based on eclipse.

Example:

-Hello!  
I'm trying to match  
some stuff  
-Hello!  
Burbpaoiwjf  
paowijefpioj  
-Hello!  

Match pattern:

(?s)-Hello!(.*?)(?=-Hello!)

This will match, but I can't replace the matched text with anything.

解决方案

This is a known bug.

As a work-around, change your search pattern to:

(?s)-Hello!(.*?)-Hello!

And include

-Hello!

in your replace string.

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

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