Re: [xsl] XSLT Regex for Matching Curly Braces

Subject: Re: [xsl] XSLT Regex for Matching Curly Braces
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Jun 2019 17:30:40 -0000
On 10.06.2019 19:21, Michael Kay mike@xxxxxxxxxxxx wrote:


On 10 Jun 2019, at 17:56, Imsieke, Gerrit, le-tex
gerrit.imsieke@xxxxxxxxx <mailto:gerrit.imsieke@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx
<mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:

If you want to use xsl:analyze-string with XSLT 2.0 (or 3.0), you can
put the regex in a variable, like so:


<xsl:variable name="regex" as="xs:string" select="'\{([^}]+)\}'"/>

I think it's even clearer to use


<xsl:variable name="regex" as="xs:string"
expand-text="no">{([^}]+)\}</xsl:variable>

You would still need to escape the curly brace { as \{, no?


Current Thread