[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Regexp] Possible bug in regexp
From: |
Peter Hanusiak |
Subject: |
[Regexp] Possible bug in regexp |
Date: |
Fri, 1 Nov 2002 03:27:38 +0100 |
User-agent: |
Mutt/1.3.25i |
Hi,
I probably find a bug in regexp. It eats all memory from system.
If it's not bug, please explain me what I am doing wrong.
It show me:
Exception in thread "main" java.lang.OutOfMemoryError
<<no stack trace available>>
I'm using latest regexp with Sun's java version "1.3.1_01"
I am sending you my example code.
Thanks
Peter
example code:
package parser;
import gnu.regexp.*;
public class SQLSemicolonParser {
private SQLSemicolonParser() { }
public static void main(String[] argv) {
try {
String[] test = parse("DDweweddddddddddfff;");
for (int i = 0; i<test.length ; i++)
System.out.println(test[i]);
}
catch ( Exception e) {
}
}
public static String[] parse(String text) throws REException {
// Construct the regular expression
RE expression = new
RE("([^\\\"\\'\\;]+|\\\"[^\\\"]*\\\"|\\'[^\\']*\\')*\\;?");
REMatch[] matches = expression.getAllMatches(text);
String[] result = new String[matches.length];
for (int i = 0; i < matches.length; i++)
result[i] = matches[i].toString();
return result;
}
}
--
Peter "Hanus" Hanusiak
E-mail: address@hidden
HomePage: http://www.hanusiak.sk
Phone: +421905504772
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Regexp] Possible bug in regexp,
Peter Hanusiak <=