xslt查找和替换regex lookarounds

xslt查找和替换regex lookarounds,regex,xslt,xslt-2.0,regex-lookarounds,Regex,Xslt,Xslt 2.0,Regex Lookarounds,我对XSLT replace()有问题 XML: <root> <title>I am title</title> <body> the new formula is:<br/> the speed test 234 km/h<br> the weight is 49 kg<br/> in the 1492 Lorenzo de Medici die. etc. <dida>the mass is 5

我对
XSLT replace()
有问题

XML

<root>
<title>I am title</title>
<body>
the new formula is:<br/>
the speed test 234 km/h<br>
the weight is 49 kg<br/>
in the 1492 Lorenzo de Medici die.
etc.
<dida>the mass is 56 kn</dida>
</body>
</root>
XSLT
中,我有:

<xsl:template match="//*/text()">
<xsl:value-of select="replace(., '\(\(?\<=\\d\)\\s\(?=km\|kg\|kn\)\)', '&nbsp;')"></xsl:variable>
</xsl:template>


问题是“
的常用符号是”非常感谢!!!xml只是一个示例,在xslt的复制和粘贴中,我犯了错误。非常感谢!!!xml只是一个示例,在xslt的复制和粘贴中,我犯了一个错误。一般来说,XPath正则表达式语法是PHP和Perl所允许的语法的一个子集,您不能假设您可以简单地以这种方式重用PHP正则表达式。通常有另一种方法可以实现您想要的,通常更简单。通常XPath正则表达式语法是PHP和Perl所允许的语法的一个子集,您不能假设您可以简单地以这种方式重用PHP正则表达式。通常有另一种方法来实现你想要的,通常更简单。
<xsl:template match="//*/text()">
<xsl:value-of select="replace(., '\(\(?\<=\\d\)\\s\(?=km\|kg\|kn\)\)', '&nbsp;')"></xsl:variable>
</xsl:template>
<xsl:value-of select="replace(., '(\d)\s(km|kg|kn)', '$1!$2')"></xsl:value-of>