xsl-list
[Top] [All Lists]

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

2009-10-08 08:15:13
Alex Muir wrote:

Is there any way to avoid a syntax error with a regex containing  both
'&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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>