C++ Standard Library / std::tr1::wregex / Inkorrektes Verhalten der '\b'-Assertion
-
Donnerstag, 2. Februar 2012 09:53
Der reguläre Ausdruck L"ä\\b" passt auf den Text L"Sozietät"!
Das bedeutet, dass std::tr1::wregex den Wechsel vom Unicode "Extended Latin Block", in dem sich das 'ä' befindet, zum Unicode "Basic Latin Block", in dem sich das 't' befindet, als "Word Boundary" ('\b') interpretiert.
Ich gehe davon aus, dass es sich hierbei um einen BUG in der IsWordChar-Funktion handelt. Hierzu sagt der ECMA-262 Standard V5.1, Kapitel 15.10.2.6:
The production Assertion :: \ b evaluates by returning an internal AssertionTester closure that takes a State argument x and performs the following:
1. Let e be x's endIndex.
2. Call IsWordChar(e–1) and let a be the Boolean result.
3. Call IsWordChar(e) and let b be the Boolean result.
4. If a is true and b is false, return true.
5. If a is false and b is true, return true.
6. Return false.The production Assertion :: \ B evaluates by returning an internal AssertionTester closure that takes a State argument x and performs the following:
1. Let e be x's endIndex.
2. Call IsWordChar(e–1) and let a be the Boolean result.
3. Call IsWordChar(e) and let b be the Boolean result.
4. If a is true and b is false, return false.
5. If a is false and b is true, return false.
6. Return true.Sowohl PCRE als auch "java.util.regex.Pattern" leiden nicht an dieser Krankheit.
- Typ geändert Robert BreitenhoferMicrosoft Contingent Staff, Moderator Dienstag, 21. Februar 2012 15:38 Keine Rückmeldung des Fragenstellender
Alle Antworten
-
Montag, 6. Februar 2012 09:07Moderator
Welche VS-C++ Version hast Du? SP1 installiert?
Hast Du ein fertiges mini Sample?Ich kann es an die Produktgruppe weiterleiten, oder du öffnest selbst einen Bug auf http://connect.microsoft.com
Martin Richter -- MVP for VC++ [Germany] -- http://blog.m-ri.de -
Dienstag, 21. Februar 2012 15:37Besitzer****************************************************************************************************************
Dieser Thread wurde mangels weiterer Beteiligung des Fragestellenden ohne bestätigte Lösung abgeschlossen.
Neue Rückfragen oder Ergänzungen zu diesem Thread bleiben weiterhin möglich.
****************************************************************************************************************Robert Breitenhofer, MICROSOFT

Bitte haben Sie Verständnis dafür, dass im Rahmen dieses Forums, welches auf dem Community-Prinzip „Entwickler helfen Entwickler“ beruht, kein technischer Support geleistet werden kann oder sonst welche garantierten Maßnahmen seitens Microsoft zugesichert werden können.

