View source code
Display the source code in std/regex.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Function std.regex.matchAll

Initiate a search for all non-overlapping matches to the pattern re in the given input. The result is a lazy range of matches generated as they are encountered in the input going left to right.

auto matchAll(R, RegEx) (
  R input,
  RegEx re
)
if (isSomeString!R && isRegexFor!(RegEx, R));

auto matchAll(R, String) (
  R input,
  String re
)
if (isSomeString!R && isSomeString!String);

auto matchAll(R, String)()
if (isSomeString!R && isSomeString!String);

This function picks the most suitable regular expression engine depending on the pattern properties.

re parameter can be one of three types:

  • Plain string(s), in which case it's compiled to bytecode before matching.
  • Regex!char (wchar/dchar) that contains a pattern in the form of compiled bytecode.
  • StaticRegex!char (wchar/dchar) that contains a pattern in the form of compiled native machine code.

Returns

RegexMatch object that represents matcher state after the first match was found or an empty one if not present.

Authors

Dmitry Olshansky,

API and utility constructs are modeled after the original std.regex by Walter Bright and Andrei Alexandrescu.

License

Boost License 1.0.