I'm needing my program to capture an item from a certain text, but it's not doing it, instead it's capturing everything that comes after that.
Code that I'm using, eg:
String html = "ItemPago12.569,00DeducoesPagas36.567,52ItensQnt6DeducoesRetidas21.354,11";
Pattern conteudo = Pattern.compile("ItemPago([^<]+)Deducoes");
Matcher match = conteudo.matcher(html);
match.find();
System.out.println(match.group(1));
Running program: link
I need to get what's in the middle, between: ItemPago
and Deducoes
. I would like examples and explanations of how to use this method correctly. Thank you.