Re: [Regexp] Possible non-conformance with Perl 5 in java distribution of gnu.regexp

Wes Biggs <[email protected]>
Newsgroups gmane.comp.gnu.regexp
Message-ID <[email protected]>
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
>[email protected]
>http://lists.gnu.org/mailman/listinfo/gnu-regexp-users
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.