Struct sedregex::ReplaceCommand[][src]

pub struct ReplaceCommand<'a> { /* fields omitted */ }
Expand description

A replace command, ready to be applied on your text.

let cmd = ReplaceCommand::new("s/world/世界/i").unwrap();
assert_eq!("Hello, 世界!", cmd.execute("Hello, world!"));
assert_eq!("The 世界 is a cruel place", cmd.execute("The world is a cruel place"));

Implementations

Parses the given command in a form of s/<expr>/<replace>/<flags> and builds a regular expression.

Usage notes
  • Delimiter slashes (/) could be escaped by a backslash: \/
  • For the list of supported commands please refer to the Command enum
  • For the list of supported flags please refer to the RegexFlag enum

Executes the command on the given text.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.