Olá, estou com um problema ao usar o pacote regex onde os padroes estao casando um sim e um nao.
OBS: estou usando um arquivo em codificação “UTF-8”.
static void lineProcess()
{
int number_of_pages = 0, first_page = 0, last_page = 0;
matcher = Pattern.compile("-+ Page [0-9]+-+").matcher(texto);
boolean c = false;
while (matcher.find())
{
if (matcher.find())
{
System.out.println(matcher.group());
matcher2 = Pattern.compile(".+?").matcher(matcher.group());
while (matcher2.find())
if (matcher2.find())
x = x + matcher2.group();
}
}
}