// 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"Remarks: ([^\r]+)Members:").unwrap();
let string = "GBRG0A 00005 JULIEx 11/27/17 11:03:12 X3311073-00X DAMAGE
Dig No : X3311073 Rev : 00X Digstart: 11/27/17 11:01
Rcvd : 11/27/17 11:03 Priority: 0 Expires : 12/24/17 23:59
Org Dig: X3311073 Rcvd: 11/27/17 11:01
Firm : KNOX CONSTRUCTION Caller: DUSTIN KNOX
CoAddr1: 1386 BRIDGEPORT RD
City,St: MAQUON, IL Zip : 61458
Phone : 309-337-6576 Ext :
Call Bk: Done For : PATTY BAILEY
SiteCnt: DUSTIN KNOX Phone : 309-337-6576
County : KNOX Place: GALESBURG CIT
Address: 522 ISLE ROYALE RD
Subdiv : Cross: LOSEY ST
Grids : T11NR01E09SW
BestFit: 40.954957/-90.400618 40.954938/-90.399043
: 40.953819/-90.400632 40.953799/-90.399057
PreMark: YES Directional Boring: NO Depth>7Ft: NO
Locatn : IN THE CITY OF GALESBURG,
WrkType: FENCE POST INSTALLATION ***HIT LINE****
Extent : LOCATE: THE WEST SIDE OF THE HOUSE.
Remarks: REFER TO DIG# X003241591 TO ALL COMPANIES, CALLER STATES HIT A
: MISMARKED CENTURY LINK LINE. CREW IS ON SITE. CALLED IN BY DUSTIN.
Members: COMC0A GBRG0A GSD0A GSD0B IPC6A SCNT3A USIC0A
View map at:
http://newtin.julie1call.com/newtinweb/map_tkt.nap?TRG=32WSVUQRTTVORRtwo2";
// 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/