Struct verex::Verex
[−]
[src]
pub struct Verex { // some fields omitted }
The struct used for building verbal expression objects
Methods
impl Verex
[src]
fn new() -> Verex
Standard Constructor
fn from_string(string: String) -> Verex
Create a Verex
object from a String
fn from_str(string: &str) -> Verex
Create a Verex
object from a &str
fn add(&mut self, value: &str) -> &mut Verex
Add a string to the regex string in the Verex
and return self
fn update_source_with_modifiers(&mut self) -> &mut Verex
Update the source string from the (presumably changed) builder string
fn compile(&self) -> Result<Regex, Error>
Compile the Verex
to a Regex
and return the result
fn raw(&self) -> &str
Return the raw regex string contained in the Verex
fn regex(&self) -> Result<Regex, Error>
Compile the Verex
to a Regex
and return the result
fn source(&self) -> &str
Return the raw regex string contained in the Verex
fn value(&self) -> &str
Return the raw regex string contained in the Verex
fn open_class(&mut self) -> &mut Verex
Open a character class
fn close_class(&mut self) -> &mut Verex
Close a character class
fn open_group(&mut self) -> &mut Verex
Open a non-capturing group
fn open_capturing_group(&mut self) -> &mut Verex
Open a capturing group
fn close_group(&mut self) -> &mut Verex
Close a capturing or non-capturing group
fn any(&mut self, chars: &str) -> &mut Verex
Any of the given characters
fn any_of(&mut self, chars: &str) -> &mut Verex
See any()
fn anything(&mut self) -> &mut Verex
Any character zero or more times
fn anything_but(&mut self, value: &str) -> &mut Verex
Any character zero or more times except the provided characters
fn br(&mut self) -> &mut Verex
A line break!
fn capture(&mut self, value: &str) -> &mut Verex
Find a specific string and capture it
fn digit(&mut self) -> &mut Verex
Add the token for matching digits
fn end_of_line(&mut self) -> &mut Verex
Add a token for matching the end of a line
fn find(&mut self, value: &str) -> &mut Verex
Find a specific string
fn line_break(&mut self) -> &mut Verex
A line break!
fn maybe(&mut self, value: &str) -> &mut Verex
Any string either one or zero times
fn or(&mut self) -> &mut Verex
Either match the sub-expression before or after this
fn or_find(&mut self, value: &str) -> &mut Verex
Either match the sub-expression before or the provided value
fn range(&mut self, range: Vec<(char, char)>) -> &mut Verex
A range of characters e.g. [A-Z] Usage example: verex.range(vec![('a', 'z'),('A', 'Z')])
fn replace(&self, text: &str, replacement: &str) -> Result<String, Error>
Replace a substring
fn search_one_line(&mut self, enable: bool) -> &mut Verex
Toggle whether ^ and $ match line start and end or string start and end
fn something(&mut self) -> &mut Verex
Any character at least one time
fn something_but(&mut self, value: &str) -> &mut Verex
Any character at least one time except for these characters
fn start_of_line(&mut self) -> &mut Verex
Add a token for the start of a line
fn tab(&mut self) -> &mut Verex
Add a token for a tab
fn then(&mut self, value: &str) -> &mut Verex
To use find "in the sentence" and make the chaining flow better
fn with_any_case(&mut self, enable: bool) -> &mut Verex
Toggle whether to match case-sensitively or not
fn word(&mut self) -> &mut Verex
Any alphanumeric characters
Trait Implementations
impl Clone for Verex
[src]
fn clone(&self) -> Verex
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Verex
[src]
impl Display for Verex
[src]
impl Eq for Verex
[src]
impl FromStr for Verex
[src]
type Err = Void
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Verex, Void>
Parses a string s
to return a value of this type. Read more
impl PartialEq for Verex
[src]
Equality comparison is based on the original string. It is possible that different verbal expressions have the same matching behavior, but are still compared unequal.