PCRE.CompiledRegex

Compiled regex class. Enables a regex pattern to be compiled once and used for multiple searches.

Destructor

~this
~this()

Destructor. Frees the C-allocated pcre object.

Members

Functions

compile
void compile(cstring pattern, bool case_sens)

Compiles the specified regex for use in the match() method. Cleans up a previously compiled regex, if this instance has been used before.

findAll
cstring[] findAll(cstring subject, cstring[] matches_buffer)

Performs a regular expression match and returns an array of slices of all matches

findFirst
cstring findFirst(cstring subject)

Performs a regular expression match and return the first found match

match
bool match(cstring subject)

Perform a regular expression match.

study
void study()

Study a compiled regex in order to increase processing efficiency when calling match(). This is usually only worth doing for a regex which will be used many times, and does not always yield an improvement in efficiency.

Meta