RegExpT

Regular expression compiler and interpreter.

Constructors

this
this(const(char_t)[] pattern, const(char_t)[] attributes)
this(const(char_t)[] pattern, bool swapMBS, bool unanchored, bool printNFA)

Construct a RegExpT object.

Members

Aliases

charclass_t
alias charclass_t = CharClass!(dchar)
Undocumented in source.
predicate_t
alias predicate_t = Predicate!(dchar)
Undocumented in source.
tdfa_t
alias tdfa_t = TDFA!(dchar)
Undocumented in source.
tnfa_t
alias tnfa_t = TNFA!(dchar)
Undocumented in source.

Functions

compileToD
const(char)[] compileToD(const(char)[] func_name, bool lexer)

Compiles the regular expression to D code.

match
const(char_t)[] match(uint index)

Return submatch with the given index.

opApply
int opApply(int delegate(RegExpT!(char_t)) dg)

Set up for start of foreach loop.

opIndex
const(char_t)[] opIndex(uint index)

Return submatch with the given index.

pattern
const(char_t)[] pattern()

Get the pattern with which this regex was constructed.

post
const(char_t)[] post()

Return the slice of the input that follows the matched substring. If no match was found, the whole slice of the input that was processed in the last test.

pre
const(char_t)[] pre()

Return the slice of the input that precedes the matched substring. If no match was found, null is returned.

replaceAll
char_t[] replaceAll(const(char_t)[] input, const(char_t)[] replacement, char_t[] output_buffer)

Returns a copy of the input with all matches replaced by replacement.

replaceAll
char_t[] replaceAll(const(char_t)[] input, char_t[] delegate(RegExpT!(char_t)) dg, char_t[] output_buffer)

Calls dg for each match and replaces it with dg's return value.

replaceFirst
char_t[] replaceFirst(const(char_t)[] input, const(char_t)[] replacement, char_t[] output_buffer)

Returns a copy of the input with the first match replaced by replacement.

replaceLast
char_t[] replaceLast(const(char_t)[] input, const(char_t)[] replacement, char_t[] output_buffer)

Returns a copy of the input with the last match replaced by replacement.

search
RegExpT!(char_t) search(const(char_t)[] input)

Set up for start of foreach loop.

split
inout(char_t)[][] split(inout(char_t)[] input)

Splits the input at the matches of this regular expression into an array of slices.

tagCount
uint tagCount()

Get the tag count of this regex, representing the number of sub-matches.

test
bool test(const(char_t)[] input)

Search input for match.

test
bool test()

Pick up where last test(input) or test() left off, and search again.

Static functions

opCall
RegExpT!(char_t) opCall(const(char_t)[] pattern, const(char_t)[] attributes)

Generate instance of Regex.

Variables

last_start_
size_t last_start_;
Undocumented in source.
next_start_
size_t next_start_;
Undocumented in source.
registers_
int[] registers_;
Undocumented in source.
tdfa_
tdfa_t tdfa_;
Undocumented in source.
tnfa_
tnfa_t tnfa_;
Undocumented in source.

Meta