Regular Expression Instructions

The xsl:analyze-string instruction uses regular expressions to apply markup to a string.

<xsl:analyze-string select="…" regex="…">
  <xsl:matching-substring>…</xsl:matching-substring>…
  <xsl:non-matching-substring>…</xsl:non-matching-substring>…
</xsl:analyze-string>

The regex-group() function allows you to look back at matching substrings.