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 Christian Ribeaud <ch...@predict.ch> on 2001/01/15 22:26:28 UTC

StackOverflowError and back reference

Hi,

I am writing a jsp and I have got 2 problems regarding the regexp package:
1) the following code generates a java.lang.StackOverflowError. Does anybody know why?
And by the way, the specifies RE do not work to match email addresses. Why?
...
RE email = new RE("(^[\\w-_\\.]*[\\w-_\\.]\\@[\\w]\\.+[\\w]+[\\w]$)");
email.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
newString = email.subst(newString,"<a href=\"mailto:xxx\">xxx</a>",RE.REPLACE_ALL);

2) How to get the back reference to the whole RE? I tried all kinds of possibility and could get the code working.
...
//RE for hyperlinks
RE hyperlinks = new RE("((ftp://)|(http://)([:alnum:]|[:punct:])*)");
hyperlinks.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
newString = hyperlinks.subst(newString,"<a href=\"\\0\">yyy</a>",RE.REPLACE_ALL);

I would be very grateful if someone could help me. Thanks in advance and have a nice day.
Best regards,

christian


Re: StackOverflowError and back reference

Posted by Yuriy Zubarev <yu...@hotmail.com>.
Hello,

2) How to get the back reference to the whole RE? I tried all kinds of
possibility and could get the code working.

When I encountered a problem of using back references in substitution string
with regexp (it interpreted strings like "\1" or "$1" as plain strings but
references) I switched to ORO (Perl5Util class) and problems had gone.

Best of luck,
Yuriy Zubarev



Re: To; All the lonley people, where do they all come from?

Posted by John Elia <je...@711.net>.
Sure it makes more sense, but I'll take the help where I can get it.  Thank
you for the heads up.. I actually thought I sent it to the user list.
Ooops!!

John

----- Original Message -----
From: "Jon Stevens" <jo...@latchkey.com>
To: <re...@jakarta.apache.org>
Sent: Wednesday, January 17, 2001 6:06 PM
Subject: Re: To; All the lonley people, where do they all come from?


> on 1/17/01 3:02 PM, "John Elia" <je...@711.net> wrote:
>
> > Has anyone had any experience with this one?
> >
> > I have an application I am working on, and things are going just swell.
I do
> > have one issue.  When I open a certain .jsp page, I get this warning in
> > my tomcat console window.
> >
> > 2001-01-17 05:54:53 - Ctx(  ): IOException in: R(  +
/PLCB/image/ispb.png +
> > null) Connection aborted by peer: socket write error
> >
> > but the page still displays ok.  Out of 13 .jsp pages that I have, this
is the
> > only one that gives me this IO Exception. The funny thing is, The code
for
> > this image
> > is part of an include file that get's included with all of the pages.
> >
> > Well, it's been great talking with you good people, and I always like to
say
> > hello to my fellow Jakartians.  If someone has experienced this before,
drop
> > me a line,
> > otherwise, if someone knows what's going on, but hasn't been foolish
enough to
> > make the same bumbling mistake, clue me in! Else, I wish every one a
good
> > night's
> > siesta..
> >
> >
> > John
> >
> > jelia@711.net
>
> You might get an answer to your question if you post to the right list.
>
> Since it is a tomcat question, you should post to the tomcat-user list.
Now
> doesn't that make more sense to you than posting to the regexp list?
>
> -jon
>


Re: To; All the lonley people, where do they all come from?

Posted by Jon Stevens <jo...@latchkey.com>.
on 1/17/01 3:02 PM, "John Elia" <je...@711.net> wrote:

> Has anyone had any experience with this one?
> 
> I have an application I am working on, and things are going just swell.  I do
> have one issue.  When I open a certain .jsp page, I get this warning in
> my tomcat console window.
> 
> 2001-01-17 05:54:53 - Ctx(  ): IOException in: R(  + /PLCB/image/ispb.png +
> null) Connection aborted by peer: socket write error
> 
> but the page still displays ok.  Out of 13 .jsp pages that I have, this is the
> only one that gives me this IO Exception. The funny thing is, The code for
> this image
> is part of an include file that get's included with all of the pages.
> 
> Well, it's been great talking with you good people, and I always like to say
> hello to my fellow Jakartians.  If someone has experienced this before, drop
> me a line,
> otherwise, if someone knows what's going on, but hasn't been foolish enough to
> make the same bumbling mistake, clue me in! Else, I wish every one a good
> night's
> siesta.. 
> 
> 
> John
> 
> jelia@711.net

You might get an answer to your question if you post to the right list.

Since it is a tomcat question, you should post to the tomcat-user list. Now
doesn't that make more sense to you than posting to the regexp list?

-jon


To; All the lonley people, where do they all come from?

Posted by John Elia <je...@711.net>.
Has anyone had any experience with this one?  

I have an application I am working on, and things are going just swell.  I do have one issue.  When I open a certain .jsp page, I get this warning in
my tomcat console window.

2001-01-17 05:54:53 - Ctx(  ): IOException in: R(  + /PLCB/image/ispb.png + null) Connection aborted by peer: socket write error

but the page still displays ok.  Out of 13 .jsp pages that I have, this is the only one that gives me this IO Exception. The funny thing is, The code for this image
is part of an include file that get's included with all of the pages.

Well, it's been great talking with you good people, and I always like to say hello to my fellow Jakartians.  If someone has experienced this before, drop me a line,
otherwise, if someone knows what's going on, but hasn't been foolish enough to make the same bumbling mistake, clue me in! Else, I wish every one a good night's
siesta.. 


John

jelia@711.net