Rise_against
Rise_against

Reputation: 1060

Regular expression replace in notepad ++

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:

<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

Upvotes: 0

Views: 387

Answers (1)

Mihai Toader
Mihai Toader

Reputation: 12243

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

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

Upvotes: 6

Related Questions