// 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)(.{197})(?!(?:\r|\n))").unwrap();
let string = "IO.Unit._1.BottomBoard.Iin._1.AmpsA ,Current A Pump 1 ,29,57.80 ,0001641474794.344049,0000356036
PumpControl.Pump._1.PumpReverse.Reversing ,Pump 1 Reversing ,28,2875 ,0001641474794.026816,0000356035Faults.Pump._1.ThermalOverload.Status.Active ,Pump 1 Tripped ,24,1 ,0001641474793.000000,0000356034Faults.Pump._1.NotInAuto.Status.Active ,Pump 1 Unavailable ,24,1 ,0001641474793.000000,0000356033Faults.Pump._1.Flow.LowFlowFault.Status.Active ,Pump 1 Low Flow ,24,2 ,0001641474792.000000,0000356032Faults.Pump._1.Flow.LowFlowFault.Status.Active ,Pump 1 Low Flow ,24,4 ,0001641474792.000000,0000356031Faults.Pump._1.Flow.LowFlowFault.Status.Active ,Pump 1 Low Flow ,24,3 ,0001641474734.000000,0000355950IO.Unit._1.BottomBoard.Iin._1.AmpsB ,Current B Pump 1 ,29,0.00 ,0001641474724.555403,0000355949
";
// 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/