]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/regexst.cpp
ICU-491.11.3.tar.gz
[apple/icu.git] / icuSources / i18n / regexst.cpp
index cfc1f7d80bb0a1d94b2d79e4157fd465680a0b34..d86524990916dbc769d7ba1d06e1b02148f07a33 100644 (file)
@@ -1,7 +1,7 @@
 //
 //  regexst.h
 //
-//  Copyright (C) 2004-2008, International Business Machines Corporation and others.
+//  Copyright (C) 2004-2012, International Business Machines Corporation and others.
 //  All Rights Reserved.
 //
 //  This file contains class RegexStaticSets
@@ -79,8 +79,10 @@ static const UChar gIsWordPattern[] = {
           0x5c, 0x70, 0x7b, 0x4d, 0x7d,
 //          \     p     {    N     d     }                         Digit_Numeric
           0x5c, 0x70, 0x7b, 0x4e, 0x64, 0x7d,
-//          \     p     {    P     c     }      ]                  Connector_Punctuation
-          0x5c, 0x70, 0x7b, 0x50, 0x63, 0x7d, 0x5d, 0};
+//          \     p     {    P     c     }                         Connector_Punctuation
+          0x5c, 0x70, 0x7b, 0x50, 0x63, 0x7d,
+//          \     u     2    0     0     c      \     u     2    0     0     d     ]
+          0x5c, 0x75, 0x32, 0x30, 0x30, 0x63, 0x5c, 0x75, 0x32, 0x30, 0x30, 0x64, 0x5d, 0};
 
 
 //
@@ -146,7 +148,8 @@ RegexStaticSets *RegexStaticSets::gStaticSets = NULL;
 RegexStaticSets::RegexStaticSets(UErrorCode *status)
 :
 fUnescapeCharSet(UnicodeString(TRUE, gUnescapeCharPattern, -1), *status),
-fRuleDigitsAlias(NULL)
+fRuleDigitsAlias(NULL),
+fEmptyText(NULL)
 {
     // First zero out everything
     int i;
@@ -214,6 +217,10 @@ fRuleDigitsAlias(NULL)
     for (i=0; i<(int32_t)(sizeof(fRuleSets)/sizeof(fRuleSets[0])); i++) {
         fRuleSets[i].compact();
     }
+    
+    // Finally, initialize an empty string for utility purposes
+    fEmptyText = utext_openUChars(NULL, NULL, 0, status);
+    
     return; // If we reached this point, everything is fine so just exit
 
 ExitConstrDeleteAll: // Remove fPropSets and fRuleSets and return error
@@ -233,6 +240,8 @@ RegexStaticSets::~RegexStaticSets() {
         fPropSets[i] = NULL;
     }
     fRuleDigitsAlias = NULL;
+    
+    utext_close(fEmptyText);
 }