Re: [xsl] Anyway to avoid a syntax error when matching with a regex containing both '&quot for example ['"](.*?)["']

Subject: Re: [xsl] Anyway to avoid a syntax error when matching with a regex containing both '&quot for example ['"](.*?)["']
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Thu, 08 Oct 2009 14:14:42 +0200
Alex Muir wrote:

Is there any way to avoid a syntax error with a regex containing  both
&apos;&quot for example ['"](.*?)["'] in the following select.

<xsl:value-of select="matches(., '[&apos;&quot;](.*?)[&quot;&apos;]')"/>

You need to escape the inner ' by doubling it


<xsl:value-of select="matches(., '[''&quot;](.*?)[&quot;'']')"/>
--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread