如何搜索$ {foo}并替换为< c:out value =“$ {foo}”/>在Eclipse编辑器中? [英] How to search for ${foo} and replace by <c:out value="${foo}"/> in Eclipse editor?
问题描述
$ b
之前:
$ {person.dog.name}
之后:
< c:out value =$ {person.dog.name}/>
我需要在Eclipse编辑器中使用它,内部部分更改。
这也可以有用:
搜索: \ $ \ {(。*?)\}
替换: \ $ \ {fn:escapeXml\($ 1\)\}
$ {person.dog.name}
成为
$ {fn:escapeXml(person.dog.name)}
查找表达式:
(\ $ \ {[^ \}] + \})
,替换表达式将是:
< c:out value =$ 1/>
要查找 $ {person.dog.name} $ c $在Eclipse编辑器中使用
< c:out value =$ {person.dog.name}/>
编辑:
使用它时要小心,因为< c:if test = $ {foo}>
将最终像< c:if test =< c:out value =$ {foo}/>> ;
Is there a regex to replace the outer part of a string while keeping the inner part?
before:
${person.dog.name}
after:
<c:out value="${person.dog.name}"/>
I need to use it in Eclipse editor, and the inner part changes.
This can be useful too:
Search: \$\{(.*?)\}
Replace:\$\{fn:escapeXml\($1\)\}
${person.dog.name}
become
${fn:escapeXml(person.dog.name)}
Find expression with:
(\$\{[^\}]+\})
and replace expression will be:
<c:out value="$1"/>
To find ${person.dog.name}
with <c:out value="${person.dog.name}"/>
in Eclipse editor!
Edit:
Be careful while using it, because <c:if test="${foo}">
will end up like <c:if test="<c:out value="${foo}" />">
这篇关于如何搜索$ {foo}并替换为< c:out value =“$ {foo}”/>在Eclipse编辑器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!