You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Seth van buren <se...@eserv.com.au> on 2001/08/18 02:05:56 UTC

RE: Regexp broken

Edwin,
I think it's broken.  I am using the \w tag in my regular expresion.  It
woin't match something with an underscore (_) in it.  I have tried it in the
test suite and it does not work.  The javadoc says it should.

I would have submitted a bug already, but Bugzilla has been unavailable for
sometime now.

Anyone else had similar experiences?

Regards
Seth


-----Original Message-----
From: Edwin Martin [mailto:edwin@bitstorm.nl]
Sent: Friday, 8 June 2001 9:24 AM
To: regexp-user@jakarta.apache.org
Subject: Regexp broken


According to the Jakarta website, regexp "stood up quite well
to the test of time".

Is this true?

I made a JSP page with strange results.

Assume I have a string like "{regexp-1.2}" and I want to match
everything between the brackets (thus "regexp-1.2").

Let's try some regular expressions:

Input string "{regexp-1.2}" and RE "([a-z0-9]+)" match: "regexp"
Input string "{regexp-1.2}" and RE "([a-z0-9-]+)" match: "{regexp-1.2}"
Input string "{regexp-1.2}" and RE "([a-z0-9.]+)" match: "regexp"
Input string "{regexp-1.2}" and RE "([a-z0-9.-]+)" match: "{regexp"
Input string "{regexp-1.2}" and RE "([a-z0-9\-]+)" match: "regexp-1"
Input string "{regexp-1.2}" and RE "([a-z0-9\.]+)" match: "regexp"
Input string "{regexp-1.2}" and RE "([a-z0-9\.\-]+)" match: "regexp-1"
Input string "{regexp-1.2}" and RE "([a-z0-9.\-]+)" match: "regexp-1"
Input string "{regexp-1.2}" and RE "([a-z0-9\.-]+)" match: "{regexp"

No one of them gives "regexp-1.2"!

What should the regular expression be??

Of course we can use "[^{}]+", but that's not wat I want here,
the brackets can be any non-[a-z0-9.-].

Or is regexp broken and does nobody have the courage to admit it?

Edwin Martin.


BTW This is the JSP-code, so you can try it yourself:

<%@ page import="org.apache.regexp.*" %>

<%!
JspWriter JspOut;

public void reTest( String in, String re ) throws java.io.IOException,
org.apache.regexp.RESyntaxException {
         JspOut.print( "Input string \""+in+"\" and RE \""+re+"\" match: ");
         RE testRe = new RE(re);
         if ( testRe.match( in ) )
                 JspOut.print( "\""+testRe.getParen(1)+"\"" );
         else
                 JspOut.print( "no match" );
         JspOut.print("<br>");
}
%>

<%
JspOut = out;

String s = "{regexp-1.2}";
reTest( s, "([a-z0-9]+)" );
reTest( s, "([a-z0-9-]+)" );
reTest( s, "([a-z0-9.]+)" );
reTest( s, "([a-z0-9.-]+)" );
reTest( s, "([a-z0-9\\-]+)" );
reTest( s, "([a-z0-9\\.]+)" );
reTest( s, "([a-z0-9\\.\\-]+)" );
reTest( s, "([a-z0-9.\\-]+)" );
reTest( s, "([a-z0-9\\.-]+)" );
%>





RE: Regexp broken

Posted by Seth van buren <se...@eserv.com.au>.
Well, well, seems as though the only way anything will get done on this
project is to start a flame war on slash dot.

Who wants to through the first punch.

Regards
Seth

-----Original Message-----
From: Edwin Martin [mailto:edwin@bitstorm.nl]
Sent: Tuesday, 12 June 2001 5:47 AM
To: regexp-user@jakarta.apache.org
Subject: Re: Regexp broken


/Mike wrote:

>Seemed to be working when I went there. Are you going to the right place
>(http://nagoya.apache.org/bugzilla)?

I submitted the bug.

I'm afraid nothing will happen. There are eight bugs submitted
and none of them is assigned.

Well, it's free software, so I'm not allowed to expect anything :-(

http://nagoya.betaversion.org/bugzilla/buglist.cgi?product=Regexp

Bye,
Edwin Martin.

BTW
please remember with e-mail it's easy to get unintentionally offended.



Re: Regexp broken

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/11/01 12:46 PM, "Edwin Martin" <ed...@bitstorm.nl> wrote:

> please remember with e-mail it's easy to get unintentionally offended.

Especially if the original person didn't intend to offend someone.

-jon


Re: Regexp broken

Posted by Edwin Martin <ed...@bitstorm.nl>.
/Mike wrote:

>Seemed to be working when I went there. Are you going to the right place
>(http://nagoya.apache.org/bugzilla)?

I submitted the bug.

I'm afraid nothing will happen. There are eight bugs submitted
and none of them is assigned.

Well, it's free software, so I'm not allowed to expect anything :-(

http://nagoya.betaversion.org/bugzilla/buglist.cgi?product=Regexp

Bye,
Edwin Martin.

BTW
please remember with e-mail it's easy to get unintentionally offended.


Re: Regexp broken

Posted by Mike Dougherty <Mi...@san.rr.com>.
Seth van buren wrote:
> 
> Edwin,
> I think it's broken.  I am using the \w tag in my regular expresion.  It
> woin't match something with an underscore (_) in it.  I have tried it in the
> test suite and it does not work.  The javadoc says it should.
> 

Post your examples and we'll take a look. 


> I would have submitted a bug already, but Bugzilla has been unavailable for
> sometime now.
> 
> Anyone else had similar experiences?
> 

Seemed to be working when I went there. Are you going to the right place
(http://nagoya.apache.org/bugzilla)?


/mike

-- 
******************************************
 Mike Dougherty -- Java Software Engineer
******************************************

Re: Regexp broken

Posted by Mike Dougherty <Mi...@san.rr.com>.
Jon Stevens wrote:
> 
> on 6/10/01 9:58 PM, "Mike Dougherty" <Mi...@san.rr.com> wrote:
> 
> > I can safely recommend it without getting
> > chewed out for recommending older code.
> 
> You were not chewed out...just corrected...

I didn't say you "chewed me out", I didn't say
anyone chewed me out. What I did say, and intended
to imply was that if my solution to the problem
was to bail on Jakarta regexp and use GNU (which I
knew worked) I would have been "chewed out". Maybe
not by you, but I'm sure by someone. I am kind of
adverse to recommending a "competing" product on
this list (unless I can't avoid it), and I am sure
there maybe a few others on this list that feel
the same way.

> 
> Sigh, if you can't take being corrected...

I can take being corrected. However, the tone of
your message wasn't said as a mere correction. I
sounded more like you were calling me a liar. I
made a mistake, for which I will admit to not
having done adequate research. I did not
intentionally attempt to defame the Jakarta Regexp
name or spread misinformation.

I was doing my best to help solve the problem(s)
and answer questions. Being that I have only been
a member of this list for a short time, I am bound
to make mistakes. What I found very irritating,
and thus my irritated responses, the only input we
were able to get from one of the more experienced
people on the list was to correct my mistakes. It
might have been more helpful had you corrected my
mistakes *and* proposed a solution to the
problems.

/mike


-- 
******************************************
 Mike Dougherty -- Java Software Engineer
******************************************

Re: Regexp broken

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/10/01 9:58 PM, "Mike Dougherty" <Mi...@san.rr.com> wrote:

> I can safely recommend it without getting
> chewed out for recommending older code.

You were not chewed out...just corrected...

Sigh, if you can't take being corrected...

-jon


Re: Regexp broken

Posted by Mike Dougherty <Mi...@san.rr.com>.
Jon Stevens wrote:
> 
> on 6/8/01 12:49 AM, "Mike Dougherty" <Mi...@san.rr.com> wrote:
> 
> > GNU regexp is Jakarta Regexp. GNU still has a link to the old version
> > from their Java site. But the package has been moved under the Apache
> > umbrella.
> 
> I'm sorry, but that is not true at all.
> 
> Jakarta Regexp is NOT GNU regexp.
> 

I know the Regexp page attributes Jonathan Locke
for donating Regexp. "donated to the Apache
Software Foundation by Jonathan Locke." And I
wasn't trying to take anything away from the
original author(s). I just thought I remembered
the GNU package being done by the same author. 

The original question was:

> > also, does anyone have an opinion on gnu regex
> > or oro regex as a suitable alternative?


I've been using the GNU regexp for years, and I
know it works. Since no of us seem to be able to
get this one working. I'd have to say try ORO, if
that's to complicated then get the GNU regexp.
Since we are now aware that they are not the same
code I can safely recommend it without getting
chewed out for recommending older code.

The web address:
http://www.cacas.org/java/gnu/regexp

/mike


-- 
******************************************
 Mike Dougherty -- Java Software Engineer
******************************************

Re: Regexp broken

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/8/01 12:49 AM, "Mike Dougherty" <Mi...@san.rr.com> wrote:

> GNU regexp is Jakarta Regexp. GNU still has a link to the old version
> from their Java site. But the package has been moved under the Apache
> umbrella.

I'm sorry, but that is not true at all.

Jakarta Regexp is NOT GNU regexp.

> I don't know about ORO. I do know that there is an ORO under Jakarta
> also. But whether they are one in the same I do not know.

They are.

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Ballmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


Re: Regexp broken

Posted by "Edward Q. Bridges" <eb...@argotec.de>.
here's my earlier post:
http://marc.theaimsgroup.com/?l=jakarta-regexp-user&m=99130971224497&w=2



On Fri, 08 Jun 2001 00:49:46 -0700, Mike Dougherty wrote:

>If that doesn't help you
>solve yours post your message (since it looks like it was previous to my
>joining) and we'll take a look.
>
>/mike

--------------------------------------------
<argo_tec gmbh>
     ed.q.bridges
     tel. 089-368179.xx
     fax 089-368179.79
     osterwaldstraße 10 
     (haus F eingang 21)
     80805 münchen
</argo_tec gmbh>
--------------------------------------------  



Re: Regexp broken

Posted by Mike Dougherty <Mi...@san.rr.com>.
"Edward Q. Bridges" wrote:
> 
> likewise, i've come across issues with regexp (i just joined this list about
> a week ago because i came across a problem -- see my posts from a few days
> ago).  is anyone actively maintaining the package?

I've only been on the list a few days myself. But I have to assume so.
It hasn't been a few active list (which surprised me) though.

> 
> also, does anyone have an opinion on gnu regex or oro regex as a suitable
> alternative?

GNU regexp is Jakarta Regexp. GNU still has a link to the old version
from their Java site. But the package has been moved under the Apache
umbrella.

I don't know about ORO. I do know that there is an ORO under Jakarta
also. But whether they are one in the same I do not know.

Take a look at my answer to Edwin's trouble. If that doesn't help you
solve yours post your message (since it looks like it was previous to my
joining) and we'll take a look.

/mike


-- 
******************************************
 Mike Dougherty -- Java Software Engineer
******************************************

RE: Regexp broken

Posted by "Edward Q. Bridges" <eb...@argotec.de>.
likewise, i've come across issues with regexp (i just joined this list about
a week ago because i came across a problem -- see my posts from a few days
ago).  is anyone actively maintaining the package?

also, does anyone have an opinion on gnu regex or oro regex as a suitable
alternative?

regards
--e--


On Sat, 18 Aug 2001 10:05:56 +1000, Seth van buren wrote:

>Edwin,
>I think it's broken.  I am using the \w tag in my regular expresion.  It
>woin't match something with an underscore (_) in it.  I have tried it in the
>test suite and it does not work.  The javadoc says it should.
>
>I would have submitted a bug already, but Bugzilla has been unavailable for
>sometime now.
>
>Anyone else had similar experiences?
>
>Regards
>Seth
>
>
>-----Original Message-----
>From: Edwin Martin [mailto:edwin@bitstorm.nl]
>Sent: Friday, 8 June 2001 9:24 AM
>To: regexp-user@jakarta.apache.org
>Subject: Regexp broken
>
>
>According to the Jakarta website, regexp "stood up quite well
>to the test of time".
>
>Is this true?
>
>I made a JSP page with strange results.
>
>Assume I have a string like "{regexp-1.2}" and I want to match
>everything between the brackets (thus "regexp-1.2").
>
>Let's try some regular expressions:
>
>Input string "{regexp-1.2}" and RE "([a-z0-9]+)" match: "regexp"
>Input string "{regexp-1.2}" and RE "([a-z0-9-]+)" match: "{regexp-1.2}"
>Input string "{regexp-1.2}" and RE "([a-z0-9.]+)" match: "regexp"
>Input string "{regexp-1.2}" and RE "([a-z0-9.-]+)" match: "{regexp"
>Input string "{regexp-1.2}" and RE "([a-z0-9\-]+)" match: "regexp-1"
>Input string "{regexp-1.2}" and RE "([a-z0-9\.]+)" match: "regexp"
>Input string "{regexp-1.2}" and RE "([a-z0-9\.\-]+)" match: "regexp-1"
>Input string "{regexp-1.2}" and RE "([a-z0-9.\-]+)" match: "regexp-1"
>Input string "{regexp-1.2}" and RE "([a-z0-9\.-]+)" match: "{regexp"
>
>No one of them gives "regexp-1.2"!
>
>What should the regular expression be??
>
>Of course we can use "[^{}]+", but that's not wat I want here,
>the brackets can be any non-[a-z0-9.-].
>
>Or is regexp broken and does nobody have the courage to admit it?
>
>Edwin Martin.
>
>
>BTW This is the JSP-code, so you can try it yourself:
>
><%@ page import="org.apache.regexp.*" %>
>
><%!
>JspWriter JspOut;
>
>public void reTest( String in, String re ) throws java.io.IOException,
>org.apache.regexp.RESyntaxException {
>         JspOut.print( "Input string \""+in+"\" and RE \""+re+"\" match: ");
>         RE testRe = new RE(re);
>         if ( testRe.match( in ) )
>                 JspOut.print( "\""+testRe.getParen(1)+"\"" );
>         else
>                 JspOut.print( "no match" );
>         JspOut.print("<br>");
>}
>%>
>
><%
>JspOut = out;
>
>String s = "{regexp-1.2}";
>reTest( s, "([a-z0-9]+)" );
>reTest( s, "([a-z0-9-]+)" );
>reTest( s, "([a-z0-9.]+)" );
>reTest( s, "([a-z0-9.-]+)" );
>reTest( s, "([a-z0-9\\-]+)" );
>reTest( s, "([a-z0-9\\.]+)" );
>reTest( s, "([a-z0-9\\.\\-]+)" );
>reTest( s, "([a-z0-9.\\-]+)" );
>reTest( s, "([a-z0-9\\.-]+)" );
>%>
>
>
>
>

--------------------------------------------
<argo_tec gmbh>
     ed.q.bridges
     tel. 089-368179.xx
     fax 089-368179.79
     osterwaldstraße 10 
     (haus F eingang 21)
     80805 münchen
</argo_tec gmbh>
--------------------------------------------