Libraries: RegularExpressions in MQL4 for working with regular expressions

 

RegularExpressions in MQL4 for working with regular expressions:

Regular expressions provide a formal language for quick and flexible processing of texts. Each regular expression is a pattern (mask), for which the regular expression engine tries to find matches in the source text. A pattern consists of one or more character literals, operators, or constructs.

Here is a translation of the RegularExpressions from .Net Framework 4.6.1.

To work with the library, include the Regex.mqh file from the "\MQL4\Include\RegularExpressions\" directory in your code.

Several illustrative examples are provided with the library, which at the same time serve as the test cases. All the samples are taken from the official site of Microsoft Corporation, they vividly demonstrate the main differences from the regular expressions in C# and the features of their use in the MQL4.

Author: MetaQuotes Software Corp.

 

This simple code has 5 errors

Regex x = new Regex("\\w+", RegexOptions::IgnoreCase);

Correct one is :

CRegex *x = new CRegex("\\w+", RegexOptions::IgnoreCase);

I mean the example in CodeBase should use CRegex word.

Thanks for this library.

 
This library uses it's Internal/Generics/List.mqh which conflicts with the Arrays/List.mqh shipped with metatrader.