How to apply regex, using C # in a pdf file? [closed]

-1
    private static string BuscaComparacao (string url)
        {
            Regex r =new Regex("\S+\D{3}[.]\D{3}\S+\D)";
        var result = r.Matches(url);
        return result[0].ToString();

        }

The code does not find the data I had to fetch.

    
asked by anonymous 26.07.2018 / 17:57

1 answer

1

Resolved as follows

PdfReader reader = new PdfReader(arquivo);
var page = PdfTextExtractor.GetTextFromPage(reader,1);
var exp = @"\s+\d{3}[.]\d{3}\s+\d";
Regex r =new Regex(exp);
var result = r.Matches(page);
return result[0].ToString();

thanks @joaomartins

    
26.07.2018 / 19:13