Regular Expressions in Java

-1

I need to please see if anyone can help me extract from a pdf one using regular expressions in Java the school pattern as shown in the image. I'm currently trying to extract in this way and it does not work for me. Thank you very much for your help . Sincerely,

Pattern patCol = Pattern.compile("Centro de Votación: [0-9a-zA-Z]"); 
Matcher matCol = patCol.matcher(cleanpageone);

    
asked by Escarlet Escoto 05.08.2018 в 07:34
source

1 answer

1

In your regex the + symbol is missing. It would be like this:

Centro de Votación: [0-9a-zA-Z]+/gm

I recommend using pages of the style of regex101 to test the regex that you are doing

    
answered by 05.08.2018 в 20:19