// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** * Copyright (C) 2002-2016, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: regex.h * encoding: UTF-8 * indentation:4 * * created on: 2002oct22 * created by: Andy Heninger * * ICU Regular Expressions, API for C++ */ #ifndef REGEX_H #define REGEX_H //#define REGEX_DEBUG /** * \file * \brief C++ API: Regular Expressions * * The ICU API for processing regular expressions consists of two classes, * `RegexPattern` and `RegexMatcher`. * `RegexPattern` objects represent a pre-processed, or compiled * regular expression. They are created from a regular expression pattern string, * and can be used to create `RegexMatcher` objects for the pattern. * * Class `RegexMatcher` bundles together a regular expression * pattern and a target string to which the search pattern will be applied. * `RegexMatcher` includes API for doing plain find or search * operations, for search and replace operations, and for obtaining detailed * information about bounds of a match. * * Note that by constructing `RegexMatcher` objects directly from regular * expression pattern strings application code can be simplified and the explicit * need for `RegexPattern` objects can usually be eliminated. * */ #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API #if !UCONFIG_NO_REGULAR_EXPRESSIONS #include "unicode/uobject.h" #include "unicode/unistr.h" #include "unicode/utext.h" #include "unicode/parseerr.h" #include "unicode/uregex.h" // Forward Declarations struct UHashtable; U_NAMESPACE_BEGIN struct Regex8BitSet; class RegexCImpl; class RegexMatcher; class RegexPattern; struct REStackFrame; class BreakIterator; class UnicodeSet; class UVector; class UVector32; class UVector64; /** * Class `RegexPattern` represents a compiled regular expression. It includes * factory methods for creating a RegexPattern object from the source (string) form * of a regular expression, methods for creating RegexMatchers that allow the pattern * to be applied to input text, and a few convenience methods for simple common * uses of regular expressions. * * Class RegexPattern is not intended to be subclassed. * * @stable ICU 2.4 */ class U_I18N_API RegexPattern final : public UObject { … }; /** * class RegexMatcher bundles together a regular expression pattern and * input text to which the expression can be applied. It includes methods * for testing for matches, and for find and replace operations. * * <p>Class RegexMatcher is not intended to be subclassed.</p> * * @stable ICU 2.4 */ class U_I18N_API RegexMatcher final : public UObject { … }; U_NAMESPACE_END #endif // UCONFIG_NO_REGULAR_EXPRESSIONS #endif /* U_SHOW_CPLUSPLUS_API */ #endif