gnu-regexp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Regexp] Possible non-conformance with Perl 5 in java distribution o


From: Wes Biggs
Subject: Re: [Regexp] Possible non-conformance with Perl 5 in java distribution of gnu.regexp
Date: Wed, 28 Jul 2004 12:09:28 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707

Cefn Hoile wrote:


My code do define the RE and its substitute looks like this currently...

ACCEPT_ZIP_PATTERN = new RE(" *(,*) *gzip *(\1*),* *");
ACCEPT_ZIP_SUBSTITUTE = "\2";
processed_content_types =

ACCEPT_ZIP_PATTERN.substituteAll(processed_content_types, ACCEPT_ZIP_SUBSTITUTE);


Try:

ACCEPT_ZIP_PATTERN = new RE(" *(,*) *gzip *(\\1*),* *");
ACCEPT_ZIP_SUBSTITUTE = "$2";


The equivalent values which I have attempted within the java PERL5 interpreter include...

Multiple different combinations of the backreferences 1 and 2 using either \ or $ to represent them. Switching to the RE_PERL_5_S syntax instead of the default RE_PERL_5 to see if that changed anything.

I spent ages trying to debug why it didn't work in java before I verified it in the real perl engine. Now I am concerned that the java engine is actually not conformant with PERL5

Alternatively what am I doing wrong to invoke backreferences in the java distribution of gnu.regexp?

Cefn
http://cefn.com

------------------------------------------------------------------------

_______________________________________________
Gnu-regexp-users mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnu-regexp-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]