[][src]Struct onig::Syntax

pub struct Syntax { /* fields omitted */ }

Onig Syntax Wrapper

Each syntax dfines a flavour of regex syntax. This type allows interaction with the built-in syntaxes through the static accessor functions (Syntax::emacs(), Syntax::default() etc.) and the creation of custom syntaxes.

For a demonstration of creating a custom syntax see examples/syntax.rs in the main onig crate.

Methods

impl Syntax[src]

pub fn asis() -> &'static Syntax[src]

Plain text syntax

pub fn posix_basic() -> &'static Syntax[src]

POSIX Basic RE syntax

pub fn posix_extended() -> &'static Syntax[src]

POSIX Extended RE syntax

pub fn emacs() -> &'static Syntax[src]

Emacs syntax

pub fn grep() -> &'static Syntax[src]

Grep syntax

pub fn gnu_regex() -> &'static Syntax[src]

GNU regex syntax

pub fn java() -> &'static Syntax[src]

Java (Sun java.util.regex) syntax

pub fn perl() -> &'static Syntax[src]

Perl syntax

pub fn perl_ng() -> &'static Syntax[src]

Perl + named group syntax

pub fn ruby() -> &'static Syntax[src]

Ruby syntax

pub fn oniguruma() -> &'static Syntax[src]

Oniguruma Syntax

pub fn default() -> &'static Syntax[src]

Default syntax (Ruby syntax)

pub fn operators(&self) -> SyntaxOperator[src]

Retrieve the operators for this syntax

pub fn set_operators(&mut self, operators: SyntaxOperator)[src]

Replace the operators for this syntax

pub fn enable_operators(&mut self, operators: SyntaxOperator)[src]

Enable Operators for this Syntax

Updates the operators for this syntax to enable the chosen ones.

pub fn disable_operators(&mut self, operators: SyntaxOperator)[src]

Disable Operators for this Syntax

Updates the operators for this syntax to remove the specified operators.

pub fn behavior(&self) -> SyntaxBehavior[src]

Retrieves the syntax behaviours

pub fn set_behavior(&mut self, behavior: SyntaxBehavior)[src]

Overwrite the syntax behaviour for this syntax.

pub fn enable_behavior(&mut self, behavior: SyntaxBehavior)[src]

Enable a given behaviour for this syntax

pub fn disable_behavior(&mut self, behavior: SyntaxBehavior)[src]

Disable a given behaviour for this syntax

pub fn options(&self) -> RegexOptions[src]

Retireve the syntax options for this syntax

pub fn set_options(&mut self, options: RegexOptions)[src]

Replace the syntax options for this syntax

pub fn set_meta_char(&mut self, what: MetaCharType, meta: MetaChar)[src]

Set a given meta character's state

Arguments:

  • what: The meta character to update
  • meta: The value to set the meta character to

Trait Implementations

impl Clone for Syntax[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Syntax[src]

impl Debug for Syntax[src]

Auto Trait Implementations

impl Send for Syntax

impl Sync for Syntax

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.