开发者

Regular expression replace in notepad ++

开发者 https://www.devze.com 2023-02-03 21:05 出处:网络
I need to do a regex find and replace: every \"<xsl:if test=\"any/text()\" has to be replaced by \"<xsl:if test=\"normalize-space(any/text())\"

I need to do a regex find and replace:

every

"<xsl:if test="any/text()"

has to be replaced by

"<xsl:if test="normalize-space(any/text())"

I have tried Find:开发者_JAVA技巧

<xsl:if test="(.*)/text() 

replace by

<xsl:if test="normalize-space(\1/text())

but it doesn't work..

so every if statement where /text() is present, replace it by normalize-space(../text())

thx


() are special chars in regexes. You need to escape them to be able to match them. Like this:

<xsl:if test="(.*)/text\(\) 
0

精彩评论

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