Skip to main content

eval

Function eval 

Source
pub fn eval(script: &str, input: &str) -> Result<String>
Expand description

Evaluate a sed script against an input string and return the result.

This is the simplest way to use the library. For repeated use with the same script, prefer Sed::new to avoid re-parsing.

ยงExamples

let output = sed_rs::eval("s/world/rust/", "hello world\n").unwrap();
assert_eq!(output, "hello rust\n");