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

Re: Implementation Advice: Grouping Strings by Charact

Subject: Re: Implementation Advice: Grouping Strings by Character Range in XSLT 2
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Apr 2016 19:29:56 -0000
Re:  Implementation Advice: Grouping Strings by Charact
On 29.04.2016 20:38, Eliot Kimber ekimber@xxxxxxxxxxxx wrote:
I have my generated analyze-text approach working generally. However, some
of my regular expressions are not matching when I would expect them to.

For example, given this @regex value:


regex="'([&#xa9;&#xae;&#x2120;&#x2122;]+)|([&#xa6;&#xb2;&#xb3;&#xb9;&#xbc;& #xbd;&#xbe;&#xd0;&#xd7;&#xdd;&#xde;&#xf0;&#xfd;&#xfe;&#x160;&#x161;&#x2202; &#x220f;&#x2211;&#x2212;&#x222b;&#x2260;&#x2264;&#x2265;]+)|([&#x27a4;]+)'"


And this text:


"&#x00A9;&#x00AE;"

The regular expression does not match, even though the first group clearly
matches on \uA9 and \uAE.

Have I made a stupid syntax mistake in my regular expression? Is there
some subtlety to matching groups that makes XSLT different from what
Oxygen is doing? I can't see any obvious syntax error in the regular
expression.

The problem is the single quote you have wrapped the regular expression into, the regex attribute is not an XPath expression, if you wanted that you would need to use an attribute value template. So I suppose you simply want

regex="([&#xa9;&#xae;&#x2120;&#x2122;]+)|([&#xa6;&#xb2;&#xb3;&#xb9;&#xbc;&
#xbd;&#xbe;&#xd0;&#xd7;&#xdd;&#xde;&#xf0;&#xfd;&#xfe;&#x160;&#x161;&#x2202;
&#x220f;&#x2211;&#x2212;&#x222b;&#x2260;&#x2264;&#x2265;]+)|([&#x27a4;]+)"


--- Diese E-Mail wurde von Avast Antivirus-Software auf Viren gepr|ft. https://www.avast.com/antivirus

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.