ae.utils.regex

std.regex helpers

Members

Functions

applyRE
string applyRE(string str, string transformation)

Apply regex transformation (in the form of "s/FROM/TO/FLAGS") to a string.

buildReplaceTransformation
string buildReplaceTransformation(string search, string replacement, string flags)

Build a RE search-and-replace transform (as used by applyRE).

escapeRE
string escapeRE(string s)

Take a string, and return a regular expression that matches that string exactly (escape RE metacharacters).

matchAllCaptures
size_t matchAllCaptures(S s, R r, Ret delegate(Args args) fun)

Call a delegate over all matches.

matchCaptures
bool matchCaptures(S s, R r, Ret delegate(Args args) fun)

Match into a delegate.

matchInto
bool matchInto(S s, R r, ref Args args)

Lua-like pattern matching.

re
Regex!char re()

Allows specifying regular expression patterns in expressions, without having to compile them each time.

Templates

extractCaptures
template extractCaptures(T...)

Returns a range which extracts a capture from text.

Meta

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.