[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT Regex for Matching Curly Braces

Subject: Re: XSLT Regex for Matching Curly Braces
From: "gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Jun 2019 17:32:38 -0000
Re:  XSLT Regex for Matching Curly Braces
Agree, if expand-text is available (if one uses XSLT 3.0, for which there is
almost no reason not to).

Sent from MailDroid

-----Original Message-----
From: "Michael Kay mike@xxxxxxxxxxxx"
To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Mon, 10 Jun 2019 18:21
Subject: Re:  XSLT Regex for Matching Curly Braces

> On 10 Jun 2019, at 17:56, Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx
<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"

This way you avoid complications with single and double quotes as well as
curly braces: the only characters that now have an XML or XSLT-defined special
meaning are "&" and "<", and these fortunately don't have special meanings in
regular expressions.

Michael Kay

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.