// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?m)(extralibs_)(|avutil|avcodec|avformat|avdevice|avfilter|avresample|postproc|swscale|swresample)(?==)").unwrap();
let string = "extralibs_avutil=\"-pthread -lva-drm -lva -lvdpau -lX11 -lm -L/usr/lib64/valgrind -ldrm -lm -lcoregrind-amd64-linux -lvex-amd64-linux -lgcc -lmfx -lstdc++ -ldl -lOpenCL -lva -ldl\"
extralibs_avcodec=\"-lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lwebpmux -lm -lwebp -lm -pthread -pthread -lm -llzma -ldav1d -pthread -ldl -lsnappy -lstdc++ -lz -laom -lm -lpthread -lfdk-aac -lm -lgsm -lmp3lame -lm -lopenjp2 -lm -lopus -lm -lspeex -lm -ltheoraenc -ltheoradec -logg -lvorbis -lm -logg -lvorbisenc -lvorbis -lm -logg -lwebp -lm -pthread -lx264 -lpthread -lm -ldl -L/usr//usr/lib64 -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt -ldl -lnuma -lxvidcore -lva -ldl -lmfx -lstdc++ -ldl\"
extralibs_avformat=\"-lm -lxml2 -lz -llzma -lm -lbz2 -lvapoursynth-script -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lvapoursynth -lzimg -ldl -lzimg -lstdc++ -lbluray -ldl -lpthread -lxml2 -lz -llzma -lm -lfontconfig -luuid -lexpat -lfreetype -lbz2 -lpng16 -lm -lz -lm -lz -lharfbuzz -lm -lglib-2.0 -pthread -lpcre -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lz -lssl -lcrypto -lz -ldl -pthread -lrtmp -lz -lgmp -lgnutls -pthread -lgmp -lunistring -latomic -ltasn1 -lidn2 -lp11-kit -lhogweed -lgmp -lnettle -lsrt -lstdc++ -lm -lgcov -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -lssl -lcrypto -lz -ldl -pthread\"
extralibs_avdevice=\"-lm -L/usr/lib64/valgrind -ldrm -lm -lcoregrind-amd64-linux -lvex-amd64-linux -lgcc -lxcb -lXau -lXdmcp -lxcb-shm -lxcb -lXau -lXdmcp -lxcb-shape -lxcb -lXau -lXdmcp -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lGL\"
extralibs_avfilter=\"-pthread -lm -lfribidi -lass -lm -lfontconfig -luuid -lexpat -lfribidi -lfreetype -lbz2 -lpng16 -lm -lz -lm -lz -lharfbuzz -lm -lglib-2.0 -pthread -lpcre -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lnppig -lnppicc -lnppc -lnppidei -lva -lvidstab -lm -lgomp -lpthread -lzimg -lstdc++ -lOpenCL -lfontconfig -luuid -lexpat -lfreetype -lbz2 -lpng16 -lm -lz -lm -lz -lharfbuzz -lm -lglib-2.0 -pthread -lpcre -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lfreetype -lbz2 -lpng16 -lm -lz -lm -lz -lharfbuzz -lm -lglib-2.0 -pthread -lpcre -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -ldl -lmfx -lstdc++ -ldl\"
extralibs_avresample=\"-lm\"
extralibs_postproc=\"-lm\"
extralibs_swscale=\"-lm\"
extralibs_swresample=\"-lm\"
";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/