0
I am trying to extract information that comes from reading email. However when you pass the match line, it pops the following error:
{"analyzing "(?si:(Information Type[ d]+(?[ d]+)|Information Type(?[ d]+))) " - Invalid group name: group names must start with an alphabetical character."}
I’ve done several tests and I haven’t been able to identify, if anyone has an idea thank you.
string texto = @"<P CLASS=CS95E872D0><SPAN CLASS=CSE27513221><SPAN STYLE='FONT-SIZE:10.0PT'>&NBSP;</SPAN></SPAN><O:P></O:P></P>
<P CLASS='CS95E872D0'><SPAN CLASS='CSE27513221'><SPAN STYLE='FONT-SIZE:10.0PT'>TIPO DE INFORMAÇÃO: INFORMAÇÃO A SER RECUPERADA</SPAN></SPAN><O:P></O:P></P>
<P CLASS='CS95E872D0'><SPAN CLASS='CSE27513221'><SPAN STYLE='FONT-SIZE:10.0PT'>PERIODO: &NBSP;31/10/2013 A 31/10/2018</SPAN></SPAN><O:P></O:P></P>";
string pattern = @"(?si:({0}[^\d]+(?<Tipo de Informação>[\d]+)|{0}(?<Tipo de Informação>[\d]+)))";
pattern = string.Format(pattern, "Tipo de Informação");
Match match = new Regex(pattern).Match(texto);
I recommend reading of Why Regex should not be used to handle HTML?
– Woss
And "Type of information" is exactly what you are trying to capture or is just an example... besides probably not need the regex for this, it is impossible to help without something concrete
– Leandro Angelo