jakarta-regexp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning Schmiedehausen <...@intermeta.de>
Subject Bug Report and [PATCH] Fix for it
Date Mon, 25 Feb 2002 11:10:18 GMT
Hi,

consider the following test case (jakarta-regexp-1.3-dev from snapshot
2002-02-24):

--- cut ---
import org.apache.regexp.RE;

public class regtest
{
  public static void main(String args[])
  {
    try
    {
      regtest re = new regtest();
      re.execute();
    } catch(Exception e)
    {
      e.printStackTrace();
    }
  }

  public void execute()
    throws Exception
  {
    String expr = "^[\\w\\d\\.\\-]+$";
    String match ="abenteuer-friedhof.de";
    System.out.println("expr:  "+expr);
    System.out.println("match: "+match);
    RE r = new RE(expr);

    boolean matched = r.match(match);

    System.out.println("Matches: "+matched);
  }
}
--- cut ---

Running it produces:

expr:  ^[\w\d\.\-]+$
match: abenteuer-friedhof.de
Matches: false

Which is wrong. The character class contains letters, numbers, the dot
and the hyphen. At least it should.

Bug fix is attached.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

Mime
View raw message