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

RE: invalid escape sequence: \b

Subject: RE: invalid escape sequence: \b
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 29 Sep 2008 21:25:43 +0100
RE:  invalid escape sequence: \b
The \b escape sequence is not available in the regex dialect defined for use
in the XML Schema and XPath/XSLT specifications. I think the reason for this
is that the concept of a "word boundary" is too difficult to define in a
language-independent way. 

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Tony Zanella [mailto:tony.zanella@xxxxxxxxx] 
> Sent: 29 September 2008 20:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  invalid escape sequence: \b
> 
> Hello all,
> I'm using oXygen 9.3 to write a template that uses a regular 
> expression as an argument for the xslt function matches().  
> While writing the regex, I used oXygen's onboard find/replace 
> with the option for regular expression selected to test for 
> what I wanted. I managed to get the following regex working 
> on some test data:
> 
> [IVXMDC]\b
> 
> For example, given the following three lines:
> 
> VI
> Pt. XXIV
> Chapter II. CHARITABLE EFFORT
> II: England
> 
> The regex matches on all and only the roman numerals when I 
> just use oXygen's find/replace.
> 
> But when I try to plug this into an xsl instruction:
> 
> <xsl:if test="not(matches(.,'[IVXMDC]\b'))">
>          <xsl:value-of select="lower-case(.)"/>
>       </xsl:if>
> 
> I get the following error:
> 
> Description: Error at character 10 in regular expression
> "[IVXMDC]+\b": invalid escape sequence
> 
> ...and running the template breaks things. Searching the 
> forums, I found this thread:
> 
> http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/a
> rchives/200801/msg00304.html
> 
> from which I gathered that I might try to remove the 
> backslash and see if the transformation worked. But doing 
> that didn't work. Nor did escaping the backslash with another 
> backslash.
> 
> Thanks in advance for any tips. And sorry if this isn't the 
> right forum for this post.
> Tony

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.