4 // Copyright (C) 2003-2010, International Business Machines Corporation and others.
5 // All Rights Reserved.
7 // This file contains declarations for the class RegexStaticSets
9 // This class is internal to the regular expression implementation.
10 // For the public Regular Expression API, see the file "unicode/regex.h"
12 // RegexStaticSets groups together the common UnicodeSets that are needed
13 // for compiling or executing RegularExpressions. This grouping simplifies
14 // the thread safe lazy creation and sharing of these sets across
15 // all instances of regular expressions.
21 #include "unicode/utypes.h"
22 #include "unicode/utext.h"
23 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
32 class RegexStaticSets
: public UMemory
{
34 static RegexStaticSets
*gStaticSets
; // Ptr to all lazily initialized constant
37 RegexStaticSets(UErrorCode
*status
);
39 static void initGlobals(UErrorCode
*status
);
40 static UBool
cleanup();
42 UnicodeSet
*fPropSets
[URX_LAST_SET
]; // The sets for common regex items, e.g. \s
43 Regex8BitSet fPropSets8
[URX_LAST_SET
]; // Fast bitmap sets for latin-1 range for above.
45 UnicodeSet fRuleSets
[10]; // Sets used while parsing regexp patterns.
46 UnicodeSet fUnescapeCharSet
; // Set of chars handled by unescape when
47 // encountered with a \ in a pattern.
48 UnicodeSet
*fRuleDigitsAlias
;
49 UText
*fEmptyText
; // An empty string, to be used when a matcher
50 // is created with no input.
56 #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS