2#ifndef _aspose_system_regex_h_
3#define _aspose_system_regex_h_
5#include <system/text/regularexpressions/match_collection.h>
6#include <system/text/regularexpressions/match.h>
7#include <system/exceptions.h>
8#include <system/multicast_delegate.h>
10namespace System {
namespace Text {
namespace RegularExpressions {
65 ASPOSECPP_SHARED_API
bool IsMatch(
const String& input,
int startat = 0);
100 static ASPOSECPP_SHARED_API
String Replace(
const String& input,
const char_t* pattern,
const char_t* replacement);
180 TimeSpan matchTimeout = InfiniteMatchTimeout,
192 TimeSpan matchTimeout = InfiniteMatchTimeout,
193 int startat = 0,
int length = 0);
204 TimeSpan matchTimeout = InfiniteMatchTimeout,
205 int startat = 0,
int length = 0);
228 TimeSpan matchTimeout = InfiniteMatchTimeout);
238 TimeSpan matchTimeout = InfiniteMatchTimeout);
263 static bool IsMetachar(char_t ch);
272 std::unique_ptr<Detail::RegexHolder> m_regex_holder;
275 static const unsigned char s_category[];
277#ifdef __DBG_FOR_EACH_MEMBER
281 void DBG_for_each_member(DBG::for_each_member_visitor &visitor)
const override
283 Object::DBG_for_each_member(visitor);
284 visitor.add_self(
this);
289 const char* DBG_class_name()
const override {
return "Regex"; }
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Single match of regexp over string. Objects of this class should only be allocated using System::Make...
Definition: match.h:56
Regular expression that follows C#-like syntax. Objects of this class should only be allocated using ...
Definition: regex.h:30
static String Escape(const String &str)
Escapes special characters to use string as part of the pattern.
~Regex() override
Destructor.
static String Replace(const String &input, const String &pattern, const MatchEvaluator &evaluator, RegexOptions options)
Replaces all matches in string with delegate-generated replacement strings (static function).
String Replace(const String &input, const String &replacement)
Replaces all matches of regex in string with replacement string.
String Replace(const String &input, const String &replacement, int count)
Replaces substrings in string. Not implemented.
ArrayPtr< String > Split(const String &input, int count, int startat)
Splits an input string a specified maximum number of times into an array of substrings,...
MatchPtr Match(const String &input, int startat, int length=0)
Matches regex against string.
String Replace(const String &input, const char_t *replacement)
Replaces all matches of regex in string with replacement string.
TimeSpan get_MatchTimeout()
Gets matching timeout.
Definition: regex.h:53
bool IsMatch(const String &input, int startat=0)
Matches regex against string.
static String Unescape(const String &str)
Unescapes special characters in string used as part of the pattern.
RegexOptions get_Options()
Gets regex options.
Definition: regex.h:56
String ToString() const override
Converts regex to string.
Definition: regex.h:168
String Replace(const String &input, const MatchEvaluator &evaluator, int count, int startat)
Replaces all matches in string with delegate-generated replacement strings.
bool get_RightToLeft()
Checks if matching is done in right-to-left mode.
Definition: regex.h:59
MatchCollectionPtr Matches(const String &input, int startat=0)
Gets all matches of regex in given string by matching repeatedly.
static String Replace(const String &input, const String &pattern, const MatchEvaluator &evaluator)
Replaces regex matches.
static String Replace(const String &input, const String &pattern, const String &replacement)
Replaces regex matches.
static bool IsMatch(const String &input, const String &pattern, RegexOptions options=RegexOptions::None, TimeSpan matchTimeout=InfiniteMatchTimeout, int startat=0)
Checks if string matches pattern.
static ArrayPtr< String > Split(const String &input, const String &pattern, RegexOptions options=RegexOptions::None, TimeSpan matchTimeout=InfiniteMatchTimeout)
Splits string by regexp.
Regex(const String &pattern, RegexOptions options)
Constructor.
ArrayPtr< String > Split(const String &input)
Splits string by regex matches.
static MatchCollectionPtr Matches(const String &input, const String &pattern, RegexOptions options=RegexOptions::None, TimeSpan matchTimeout=InfiniteMatchTimeout, int startat=0, int length=0)
Gets all matches between string and pattern.
Regex()
Constructs empty regexp.
static MatchPtr Match(const String &input, const String &pattern, RegexOptions options=RegexOptions::None, TimeSpan matchTimeout=InfiniteMatchTimeout, int startat=0, int length=0)
Matches string and pattern.
String Replace(const String &input, const MatchEvaluator &evaluator, int count)
Replaces all matches in string with delegate-generated replacement strings.
Regex(const String &pattern)
Constructor.
static String Replace(const String &input, const char_t *pattern, const char_t *replacement)
Replaces all matches of regex in string with replacement string.
static ArrayPtr< String > Split(const String &input, const String &pattern, int count, RegexOptions options=RegexOptions::None, TimeSpan matchTimeout=InfiniteMatchTimeout)
Splits string by regexp.
String Replace(const String &input, const String &replacement, int count, int startat)
Replaces substrings in string. Not implemented.
ArrayPtr< String > Split(const String &input, int count)
Splits string by regex matches.
Regex(const String &pattern, RegexOptions options, TimeSpan matchTimeout)
Constructor.
static String Replace(const String &input, const String &pattern, const char_t *replacement)
Replaces all matches of regex in string with replacement string.
static TimeSpan InfiniteMatchTimeout
Special timeout value to disable match break by timeout.
Definition: regex.h:34
MatchPtr Match(const String &input)
Matches regex against string.
static String Replace(const String &input, const String &pattern, const String &replacement, RegexOptions options)
Replaces all matches of regex in string with replacement string.
String Replace(const String &input, const MatchEvaluator &evaluator)
Replaces all matches in string with delegate-generated replacement strings.
Represents a time interval. This type should be allocated on stack and passed to functions by value o...
Definition: timespan.h:59
@ Text
Defines color adjustment information for text.
System::SharedPtr< Regex > RegexPtr
Regex pointer.
Definition: match.h:44
std::shared_ptr< const UnicodeString > UStringPtr
Shared UnicodeString to avoid copying.
Definition: capture.h:15
System::MulticastDelegate< System::String(MatchPtr)> MatchEvaluator
Delegate type to evaluate match.
Definition: regex.h:18
RegexOptions
Regex options.
Definition: regex_options.h:10
@ RightToLeft
Right-to-left matching. Unsupported.
Definition: db_command.h:9