j'etulise les regexp ça marche bien, mais pour extraire un text d'une certaine taille les regexp montrent une limite

import org.apache.regexp.RE;
RE r = null;
String text = "ABDBbghghghdgnjgfjfghjhgjhghjkghjhhghhjj"
// si le text attient une certaine taille "40 lignes", StackOverflowError est genèré.
String regex = "([a-zA-Z \r\n]{1,})"; //par exemple

try{
r = new RE(regex,RE.MATCH_MULTILINE);
Boolean bool= r.match(text);

if(bool)
{
String str="";
for (int i = 0; i < r.getParenCount(); i++)
{
if(r.getParenLength(i)>0)
{
System.out.println(r.getParen(i));
}
else
{
System.out.println("NO MATCH");
}
}//end for
}//end if
else
{
Form.Groups.addItem("Failed match");
}
}catch(RESyntaxException REex) {Form.Groups.addItem(REex);}
catch(java.lang.StackOverflowError st){System.out.println("st "+st);}
catch(java.lang.InternalError ec){System.out.println("ec "+ec);}
catch(java.lang.StringIndexOutOfBoundsException in){System.out.println("in "+in);}
try{
this.finalize();
}catch(java.lang.Throwable g){System.out.println("g "+g);}
}
}
je ne sais pas s'il y'a une alternative au regexp , oui s'il y'a une solution pour travailler avec regexp sur des textes costaux, je n'ai pas trouvé de solution sur le net

jdk1.5 jakarta-regexp1.4
merci d'avance