diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/regex/pcre/regexp.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/regex/pcre/regexp.h')
-rw-r--r-- | library/cpp/regex/pcre/regexp.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/regex/pcre/regexp.h b/library/cpp/regex/pcre/regexp.h index bc610bd2f3..c74d20b3ad 100644 --- a/library/cpp/regex/pcre/regexp.h +++ b/library/cpp/regex/pcre/regexp.h @@ -1,16 +1,16 @@ #pragma once #include <sys/types.h> - + #include <util/system/defaults.h> #include <util/generic/string.h> #include <util/generic/yexception.h> - -#include <contrib/libs/pcre/pcre.h> -#include <contrib/libs/pcre/pcreposix.h> - + +#include <contrib/libs/pcre/pcre.h> +#include <contrib/libs/pcre/pcreposix.h> + //THIS CODE LOOKS LIKE A TRASH, BUT WORKS. - + #define NMATCHES 100 #define REGEXP_GLOBAL 0x0080 // use this if you want to find all occurences @@ -19,38 +19,38 @@ class TRegExBaseImpl; class TRegExBase { protected: TSimpleIntrusivePtr<TRegExBaseImpl> Impl; - + public: TRegExBase(const char* regExpr = nullptr, int cflags = REG_EXTENDED); TRegExBase(const TString& regExpr, int cflags = REG_EXTENDED); virtual ~TRegExBase(); - int Exec(const char* str, regmatch_t pmatch[], int eflags, int nmatches = NMATCHES) const; + int Exec(const char* str, regmatch_t pmatch[], int eflags, int nmatches = NMATCHES) const; void Compile(const TString& regExpr, int cflags = REG_EXTENDED); bool IsCompiled() const; int GetCompileOptions() const; TString GetRegExpr() const; }; -class TRegExMatch: public TRegExBase { +class TRegExMatch: public TRegExBase { public: TRegExMatch(const char* regExpr = nullptr, int cflags = REG_NOSUB | REG_EXTENDED); TRegExMatch(const TString& regExpr, int cflags = REG_NOSUB | REG_EXTENDED); - bool Match(const char* str) const; + bool Match(const char* str) const; }; -struct TBackReferences { +struct TBackReferences { int Beg; int End; int Refer; }; -class TRegExSubst: public TRegExBase { +class TRegExSubst: public TRegExBase { private: const char* Replacement; - regmatch_t PMatch[NMATCHES]; + regmatch_t PMatch[NMATCHES]; TBackReferences Brfs[NMATCHES]; int BrfsCount; @@ -59,5 +59,5 @@ public: TRegExSubst(const char* regExpr = nullptr, int cflags = REG_EXTENDED); TString Replace(const char* str, int eflags = 0); - int ParseReplacement(const char* replacement); + int ParseReplacement(const char* replacement); }; |