xsl-list
[Top] [All Lists]

Re: [xsl] Placing mark-up in between strings

2006-11-23 05:35:52

 Actually, I wanted to avoid
dealing with regex as there is no (if I'm right) an escaping
function.  I mean a function that escapes a string to can be
included in a regex to match exactly, even if it contains
regex-special characters.

Isn't that just something like:

<xsl:function name="f:escape">
  <xsl:param name="s" as="xs:string"/>
  <xsl:sequence select="replace($s,'[\\\|\.\-\^\?\*\+\(\)\{\}\[\]]','\\$0')"/>
</xsl:function>

which turns ab*c.{8} into ab\*c\.\{8\}

David 


--~------------------------------------------------------------------
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>
--~--