2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
15 PATTERN_TYPE_REGULAR_EXPRESSION
,
23 RegExp(const char* pattern
,
24 PatternType patternType
25 = PATTERN_TYPE_REGULAR_EXPRESSION
,
26 bool caseSensitive
= true);
27 RegExp(const RegExp
& other
);
31 { return fData
!= NULL
; }
33 bool SetPattern(const char* pattern
,
34 PatternType patternType
35 = PATTERN_TYPE_REGULAR_EXPRESSION
,
36 bool caseSensitive
= true);
38 MatchResult
Match(const char* string
) const;
40 RegExp
& operator=(const RegExp
& other
);
44 struct MatchResultData
;
51 class RegExp::MatchResult
{
54 MatchResult(const MatchResult
& other
);
57 bool HasMatched() const;
59 size_t StartOffset() const;
60 size_t EndOffset() const;
62 size_t GroupCount() const;
63 size_t GroupStartOffsetAt(size_t index
) const;
64 size_t GroupEndOffsetAt(size_t index
) const;
66 MatchResult
& operator=(const MatchResult
& other
);
72 MatchResult(MatchResultData
* data
);
73 // takes over the data reference
76 MatchResultData
* fData
;