Crate onig [−] [src]
This crate provides a safe wrapper around the Oniguruma regular expression library.
Examples
use onig::Regex; let regex = Regex::new("e(l+)").unwrap(); for (i, pos) in regex.captures("hello").unwrap().iter_pos().enumerate() { match pos { Some((beg, end)) => println!("Group {} captured in position {}:{}", i, beg, end), None => println!("Group {} is not captured", i) } }
Structs
| CaptureNames |
CaptureNames is an iterator over named groups as a tuple with the group name and group indexes. |
| CaptureTreeNode | |
| CaptureTreeNodeIter | |
| Captures |
Captures represents a group of captured strings for a single match. |
| Error |
This struture represents an error from the underlying Oniguruma libray. |
| FindCaptures |
An iterator that yields all non-overlapping capture groups matching a particular regular expression. |
| FindMatches |
An iterator over all non-overlapping matches for a particular string. |
| Regex |
This struct is a wrapper around an Oniguruma regular expression pointer. This represents a compiled regex which can be used in search and match operations. |
| RegexOptions |
Regex parsing and compilation options. |
| RegexSplits |
Yields all substrings delimited by a regular expression match. |
| RegexSplitsN |
Yields at most |
| Region |
Represents a set of capture groups found in a search or match. |
| SearchOptions |
Regex evaluation options. |
| SubCaptures |
An iterator over capture groups for a particular match of a regular expression. |
| SubCapturesPos |
An iterator over capture group positions for a particular match of a regular expression. |
| Syntax | |
| SyntaxBehavior | |
| SyntaxOperator |
Constants
Traits
| Replacer |
Replacer describes types that can be used to replace matches in a string. |
Functions
| copyright |
Get Copyright |
| version |
Get Version |