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