我试图在逗号后面找到p元素中的数字。例如11.112, 11A.112, 11.112f
输入
<p>U.S. patent laws, no preemption of 1.2, trade secret protection by, 11.112, 11A.112, 11.112f</p>发布于 2020-10-08 09:49:12
如果您使用
<xsl:template match="p">
<xsl:copy>
<xsl:value-of
select="analyze-string(., ',\s*([0-9]+[A-Z]*\.[0-9]+[A-Z]*)', 'i')//*:group[@nr = 1]"
separator=", "/>
</xsl:copy>
</xsl:template>你得到了<p>11.112, 11A.112, 11.112f</p>:https://xsltfiddle.liberty-development.net/gVruFNJ
https://stackoverflow.com/questions/64255789
复制相似问题