You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by "Daniel F. Savarese" <df...@savarese.org> on 2001/08/30 08:23:11 UTC

Re: JavaScript Reg. Exp.

In message <00...@visa.com>, "Joe Pardi" writes:
>Does anyone know which package (ORO or RegExp) is closer aligned to the
>regular expression features provided in JavaScript?

Page 129 of the ECMAScript specification 3rd edition
(http://www.ecma.ch/ecma1/stand/ecma-262.htm) says
"The form and functionality of regular expressions is modelled after the
 regular expression facility in the Perl 5 programming language."
Looking at the grammar on pages 129-131, it looks like it is a subset
of Perl 5.  Even though I know JavaScript, I don't really use it for
much of anything, but I've often heard complaints about inconsistencies
in regular expressions across JavaScript implementations.  At any rate,
according to the grammar, I'd say just using Perl5Util would be
compatible.

daniel



RE: JavaScript Reg. Exp.

Posted by Joe Pardi <jp...@maine.rr.com>.
Thanks Daniel,

Not sure if you're familiar with JSP and tag libraries, but what I am trying
to do is give a JSP developer an HTML form type tag that will allow them to
provide a regular expression that both client-side JavaScript and
server-side Java will use to validate the value provided in the form field.

I'm currently using the Regexp package to do it server-side but need the
library that best matches the JavaScript equivalent.  Sounds like you
recommend I should use Perl5Util instead?

By the way, nice job with all of you stuff (ORO, Regexp, etc.).


The packages are well-documented, easy to use, and very bug-free!

- joe