Regular Expression Example

These instructions transform dates of the form “12/8/2003” into ISO 8601 standard form: “2003-12-08”.

<xsl:analyze-string select="$date" 
    <xsl:number value="regex-group(3)"
    <xsl:text>-</xsl:text> ...

Note that the curly braces are doubled in the regular expression. The regex attribute is an attribute value template, so to get a single “{” in the attribute value, you must use “{{” in the stylesheet.