Re: [xsl] XSLT Regex for Matching Curly Braces

Subject: Re: [xsl] XSLT Regex for Matching Curly Braces
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Jun 2019 17:33:09 -0000
On 11.06.2019 19:26, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote:
<xsl:variable as="xs:string" name="within-braces">
     [{]      <!--* opening bace *-->
     (        <!--* $1 *-->
       [^{}]+ <!--* not containing a brace *-->
     )        <!--* end $1 *-->
     [}]      <!--* closing brace *-->
</xsl:variable>

I like this! It never came to me that I can just have text content with XML comments when defining a regex for 'x'-flag matching.



and then fn:replace($input, $within-braces, 'x'), or more likely, <xsl:analyze-string regex="$within-braces" flags="x" . .. . >

Correction: regex="{$within-braces}"

Therebs always something additional to point out here in pedantbs paradise, dear Liam!

Gerrit

Current Thread