Skip to content
All library documents

MQL4 Regular Expressions: Library Features and Usage Differences

Article BigQuant

Summary

The document introduces an MQL4 library that ports regular-expression functionality from the .NET Framework. It outlines the library’s components for patterns, matches, capture groups, options, and Unicode character categories. It also lists options such as case-insensitive matching, multiline behavior, and right-to-left searches, and explains that the port supports MetaTrader 4 build 1384 and later.

The practical notes focus on differences from C#: MQL4 patterns require explicit escaping because verbatim string literals are unavailable; match collections are traversed with an enumerator rather than foreach; and a static cache can reuse compiled expressions. The cache can be configured and cleared, with a warning to clear it only after regex work is finished because needed pointers may otherwise be removed. Examples and a test expert are mentioned, but the document contains no trading strategy, market analysis, or empirical trading evidence. It is primarily a programming reference for MQL4 developers who need to process text within trading software.

Key ideas

  • The library ports .NET regular-expression functionality to MQL4 and requires MetaTrader 4 build 1384 or later.
  • Its modules cover regex patterns, matches, captures, options, and Unicode character categories.
  • MQL4 requires explicit escaping in pattern strings and uses enumerators to process match collections.
  • A static cache can reuse regular expressions, but clearing it too early can remove needed pointers.
  • The material is a programming reference rather than a trading method or performance analysis.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.