You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by Jordi Salvat i Alabart <js...@atg.com> on 2003/11/24 17:50:25 UTC
ORO or java.util.regex?
I've found java.util.regex to be much simpler and slightly better
performing than the ORO classes for the kind of usage we need.
Any arguments against generally replacing ORO with java.util.regex, now
that we are JDK 1.4-dependent anyway?
--
Salut,
Jordi.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: ORO or java.util.regex?
Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 25 Nov 2003, Jordi Salvat i. Alabart <js...@atg.com> wrote:
> Since you seem to have Java regexp knowledge:
Not as much as you might think 8-)
> is there a way to get ORO to work on a byte[] more efficient than
> converting it into a String first?
None I was aware of. I vaguely recall Daniel talking about stream
support (and how it was difficult to do, in particular to do right),
but can't recall any details.
AwkMatcher supports something called AwkStreamInput which could be
used on top of a ByteArrayInputStream, but I don't see anything
similar for the Perl5Matcher, nor does it sound any more efficient
than using an intermediate String if you already have the complete
byte array in memory.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: ORO or java.util.regex?
Posted by Jordi Salvat i Alabart <js...@atg.com>.
Sounds like a strong argument. I'll roll back to ORO, even though we
don't expect any Perl background from our users.
Since you seem to have Java regexp knowledge: is there a way to get ORO
to work on a byte[] more efficient than converting it into a String first?
--
Salut,
Jordi.
En/na Stefan Bodewig ha escrit:
> On Mon, 24 Nov 2003, Jordi Salvat i. Alabart <js...@atg.com> wrote:
>
>
>>I've found java.util.regex to be much simpler and slightly better
>>performing than the ORO classes for the kind of usage we need.
>
>
> As a complete outsider, but one with a bit of Java regexp knowledge as
> I've coded larger parts of Ant's regexp facade that abstracts away the
> choice: I'd always prefer ORO.
>
> We've found java.util.regexp to have some strange platform dependent
> bugs that are hard if not impossible to work around, from
> <replaceregexp>'s manual:
>
> ,----
> | There are cross-platform issues for matches related to line
> | terminator. For example if you use $ to anchor your regular expression
> | on the end of a line the results might be very different depending on
> | both your platform and the regular expression library you use. It is
> | 'highly recommended' that you test your pattern on both Unix and
> | Windows platforms before you rely on it.
> |
> | * Jakarta Oro defines a line terminator as '\n' and is consistent
> | with Perl.
> |
> | * Jakarta RegExp uses a system-dependant line terminator.
> |
> | * JDK 1.4 uses '\n', '\r\n', '\u0085', '\u2028', '\u2029' as a
> | default but is configured in the wrapper to use only '\n'
> | (UNIX_LINE)
> |
> | We strongly recommend that you use Jakarta Oro.
> `----
>
> In many ways your choice depends on how much you want to expose to
> your users and what background your users are likely to have. If your
> users come from a Perl background, ORO may in fact be the better
> choice.
>
> Stefan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
Re: ORO or java.util.regex?
Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 24 Nov 2003, Jordi Salvat i. Alabart <js...@atg.com> wrote:
> I've found java.util.regex to be much simpler and slightly better
> performing than the ORO classes for the kind of usage we need.
As a complete outsider, but one with a bit of Java regexp knowledge as
I've coded larger parts of Ant's regexp facade that abstracts away the
choice: I'd always prefer ORO.
We've found java.util.regexp to have some strange platform dependent
bugs that are hard if not impossible to work around, from
<replaceregexp>'s manual:
,----
| There are cross-platform issues for matches related to line
| terminator. For example if you use $ to anchor your regular expression
| on the end of a line the results might be very different depending on
| both your platform and the regular expression library you use. It is
| 'highly recommended' that you test your pattern on both Unix and
| Windows platforms before you rely on it.
|
| * Jakarta Oro defines a line terminator as '\n' and is consistent
| with Perl.
|
| * Jakarta RegExp uses a system-dependant line terminator.
|
| * JDK 1.4 uses '\n', '\r\n', '\u0085', '\u2028', '\u2029' as a
| default but is configured in the wrapper to use only '\n'
| (UNIX_LINE)
|
| We strongly recommend that you use Jakarta Oro.
`----
In many ways your choice depends on how much you want to expose to
your users and what background your users are likely to have. If your
users come from a Perl background, ORO may in fact be the better
choice.
Stefan
--
http://stefanbodewig.blogger.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org