// 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)<p><strong>PRESIDENTE ANDRÉS MANUEL LÓPEZ OBRADOR:<\/strong>\r?\n((?:(?!<p><strong>)^[^\r\n]+\r?\n)+)").unwrap();
let string = "<p><strong>ROGELIO JIMÉNEZ PONS:</strong> Quisiera
<p>Text here...</p>
<p><strong>PRESIDENTE ANDRÉS MANUEL LÓPEZ OBRADOR:</strong>
<p>Text here...</p>
<p>Text here...</p>
<p><strong>PREGUNTA:</strong>
<p>Text here...</p>
<p><strong>PRESIDENTE ANDRÉS MANUEL LÓPEZ OBRADOR:</strong>
<p>Y la información específica la vamos a difundir a través de una página en internet, que es: www.participacionsocial.gob.mx, en su momento vamos a establecer ahí la metodología que se va a utilizar para determinar la ubicación de los módulos,
el número de boletas, la forma de identificación de las personas participantes y esa metodología va a explicar los criterios como la población, el padrón, la accesibilidad y la viabilidad de todo esto.</p>
<p>También vamos a poner toda la información del proyecto para que cualquier persona pueda consultarla y de esta manera ir fortaleciendo también toda la cuestión de la transparencia y rendición de cuentas que hemos llevado a cabo en todos los
procesos de consulta y ejercicios participativos durante este año de gobierno.</p>
<p>Gracias.</p>
<p>Ahora, vamos a escuchar a Adelfo Regino con el tema de las consultas indígenas.</p>
<p><strong>INTERLOCUTOR:</strong>
<p>Text here...</p>
<p>Text here...</p>
<p><strong>PRESIDENTE ANDRÉS MANUEL LÓPEZ OBRADOR:</strong>
<p>Text here...</p>
<p>Text here...</p>
<p>Text here...</p>
<p>Text here...</p>
<p>Text here...</p>
<p><strong>INTERLOCUTOR:</strong>
";
// 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/