Eclipse正则表达式用于查找以下字符串

[英]Eclipse regex for finding the following string


I want to search all files in my project in eclipse and replace all occurences of ConnectionID="lettersandnumbers"

我想在eclipse中搜索我项目中的所有文件,并替换所有出现的ConnectionID =“lettersandnumbers”

what is the regex for the bit between the quotation marks(including the quotations)?

引号(包括引号)之间的位的正则表达式是什么?

4 个解决方案

#1


1  

assuming you want to replace the String contents, look for

假设您要替换String内容,请查找

(ConnectionID=").*?(")

and replace with

并替换为

$1replacement$2

where replacement is what you want to replace the String with :-)

替换是你要用以下内容替换字符串:-)

#2


1  

Put this in your search box:

把它放在你的搜索框中:

ConnectionID=\"[\w]+\"

#3


1  

Try this:

尝试这个:

ConnectionID="[\p{L}\p{N}]*"

This will match all Unicode letters and numbers. Remember, à is a letter too.

这将匹配所有Unicode字母和数字。请记住,à也是一封信。

#4


0  

I would search for:

我会搜索:

ConnectionID="(.*)"

的ConnectionId = “(。*)”

If you're not interested in keeping the chars between quotes you can use

如果你不想保持引号之间的字符,你可以使用

ConnectionID=".*"

的ConnectionId = “*”

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2011/09/22/66bd11478798f0e1a4b10c88954cf861.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告