[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Special characters in regex expression

Subject: Special characters in regex expression
From: "Gabor Toth bewindoki@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jul 2014 14:54:43 -0000
 Special characters in regex expression
Dear All,

I am using xsl:analyze-string to retrieve and replace punctuation, however, I
got the following error:

 Error in regular expression: net.sf.saxon.trans.XPathException: Syntax error
at char 6 in regular expression: Escape character '!' not allowed.

How should I escape and match '?' and '!' ? I am also using a negative
look-ahead, why isn't that working?

Here is a sample from my code, thanks,


<xsl:template match="//TEI:p//text()[ not
 <xsl:analyze-string select="." regex="(\.|\!|\?)(?!\)|\.|\d|\w)">
                <xsl:element name="seg"
                <xsl:value-of select="."/>

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.