[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Syntax error in regex pattern
On Sat, Jul 13, 2019 at 04:32:39PM -0000, Scott Vanderbilt lists@xxxxxxxxxxxxx scripsit: > <xsl:analyze-string select="$stringtoproc" regex="\p{L}"> It's usually safest to use the pattern: <xsl:variable name="search" as="xs:string" select="'\p{L}'"/> <xsl:analyze-string select="$stringtoproc" regex="{$search}"> because otherwise you have to remember the parsing rules the regex attribute is using. ("Do I have to double the braces to escape them?, etc.) I can never quite manage to do that, so putting the regular expression in a string variable is just easier. In the specific case, because the regex attribute accepts attribute value templates, the braces are going to have the AVT meaning unless escaped. -- Graydon
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|