First of all, thanks for the help, I´m stuck on this issue for one week. I google and searched it here, but have no Java response, only with Python and other language that I don´t know.
I´m using java to develop an application that search for a pair of string and get the text in the middle of these two words. The example:
<A name=1></a>Some text with break lines<A name=300></a>
The main issue is, I need to get the text between these two marcations until . Grabe this text and add it to a StringBuffer.
I did this:
Pattern regex = Pattern.compile("<A name=1><\\/a>((.|\\s)+?)<A name=300><\\/a>");
Matcher matcher = regex.matcher(htmlFileReading);
if (matcher.find()) {
System.out.println("Finded");
System.out.println(matcher.groupCount());
}
It works, but when I try something bigger than, but not so big, it returns stack over flow error.
How can I get the text between these two marks? Thanks a lot, and sorry for my bad English.