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 Mike Dougherty <Mi...@san.rr.com> on 2001/06/09 08:11:54 UTC

Broken regular expressions

It seems like a lot of you have been having trouble getting the
org.apache.regexp package to work. I am relatively new to this list so I
can't tell you more than I have been able to figure out so far. I found
the following quote on the ORO page (http://jakarta.apache.org/oro):

> The Jakarta Project is lucky to also be able to offer another 
> regexp solution for you as well as this package. Options are
> a good thing and we will leave which one you choose to use 
> up to you. :-) They are both perfectly good packages, we 
> just consider the Jakarta ORO package to be more a more 
> complete regular expression package. 

So I threw the problems (at least the two that I started working on
previously) at the ORO package and came up with the following results:

> Checking expression '([a-z0-9-]+)': match found [regexp-1]
> Checking expression '([a-z0-9\-]+)': match found [regexp-1]
> Checking expression '([a-z0-9\.]+)': match found [regexp]
> Checking expression '([a-z0-9.-]+)': match found [regexp-1.2]
> Checking expression '([a-z0-9\.\-]+)': match found [regexp-1.2]
> Checking expression '([a-z0-9.\-]+)': match found [regexp-1.2]
> Checking expression '([a-z0-9\.-]+)': match found [regexp-1.2]
> Checking expression '\{?([a-z0-9-]+)\}?': match found [regexp-1]
> Checking expression '^{(\S+)}$': match found [regexp-1.2]
> Checking expression '^.(\S+).$': match found [regexp-1.2]
> 
> Checking expression '([\w\d\-\/]+?)\s+([\w\d\.\-]+)'
>         OS:      Linux
>         Version: 2.0.32

Since these are the same results as what a similar Perl script returns I
feel pretty confident that the troubles can be solved by switching to
the ORO package. The code for getting the ORO package to work is a
little different so I have attached my sample program (as ugly as it is)
so you can see how I did it.

Any questions or comment about the ORO package and how to use it should
be directed to the <or...@jakarta.apache.org>.

Hope that helps,
/mike

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