Struct oniguruma::Regex [] [src]

pub struct Regex { /* fields omitted */ }

A compiled Oniguruma regular expression.

Methods

impl Regex
[src]

Returns the capture groups corresponding to the leftmost-first match in text. Capture group 0 always corresponds to the entire match. If no match is found, then None is returned.

Panics

This method may panic in the case of memory overflow during execution or other internal errors of Oniguruma engine.

impl Regex
[src]

Compiles a regular expression with default options. Default syntax is SYNTAX_RUBY.

Once compiled, it can be used repeatedly to search in a string. If an invalid expression is given, then an error is returned.

Search pattern in string and store search result into region object.

Returns match position offset if pattern is found, otherwise return None. You also can use search time options: OPTION_NOTBOL and OPTION_NOTEOL.

Match string and store search result into region object.

Returns match length if pattern is found, otherwise return None. You also can use search time options: OPTION_NOTBOL and OPTION_NOTEOL.

Returns true if and only if the regex matches the string given.

Panics

This method may panic in the case of memory overflow during execution or other internal errors of Oniguruma engine.

Returns the start and end byte range of the leftmost-first match in text. If no match exists, then None is returned.

Note that this should only be used if you want to discover the position of the match. Testing the existence of a match is faster if you use is_match.

Panics

This method may panic in the case of memory overflow during execution or other internal errors of Oniguruma engine.

Trait Implementations

impl Debug for Regex
[src]

Formats the value using the given formatter.

impl Drop for Regex
[src]

A method called when the value goes out of scope. Read more