Error : at org.apache.regexp.RE.matchNodes(Unknown Source)
"DECAFFMEYER MATHIEU" <[email protected]> Thu, 25 Jan 2007 17:25:23 +0100
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Message-ID | <EBC8F228BDB35A4394D0BE53DA25248808A9A261@SPMWB02L.luinternal.fortis.bank> |
------=_NextPartTM-000-6bbf324e-ad63-4876-8522-f6a1e77899a4
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C7409D.69FC2A4B"
------_=_NextPart_001_01C7409D.69FC2A4B
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
my reguler expression is the following :
headlineRegex -> (<h1>)?(.*)</h1>
group -> 2
I am using the regular expression above to extract a headline (h1) from
an HTML document
while (mHeadlineRE.match(content, offset)) {
For some Html pages this regular expression works,
but for some Html pages, it gives the following errors :
[...]
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchNodes(Unknown Source)
at org.apache.regexp.RE.matchAt(Unknown Source)
at org.apache.regexp.RE.match(Unknown Source)
at org.apache.regexp.RE.match(Unknown Source)
at
net.sf.regain.crawler.preparator.html.HtmlContentExtractor.extractHeadli
nes(HtmlContentExtractor.java:140)
on this line :
while (mHeadlineRE.match(content, offset)) {
when I use this regex : <h1>(.*)</h1> =20
group 1
I never have this error.
The problem is that I don't even know how to debug this error, that's
why I am asking for some help here.
Any help is very appreciated, thank u!
__________________________________
Matthew
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Internet communications are not secure and therefore Fortis Banque Luxembou=
rg S.A. does not accept legal responsibility for the contents of this messa=
ge. The information contained in this e-mail is confidential and may be leg=
ally privileged. It is intended solely for the addressee. If you are not th=
e intended recipient, any disclosure, copying, distribution or any action t=
aken or omitted to be taken in reliance on it, is prohibited and may be unl=
awful. Nothing in the message is capable or intended to create any legally =
binding obligations on either party and it is not intended to provide legal=
advice.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
------_=_NextPart_001_01C7409D.69FC2A4B
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 6.5.7651.52">
<TITLE>Error : at org.apache.regexp.RE.matchNodes(Unknown Source)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">my reguler expression is the following :<=
/FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">headlineRegex -> (&lt;h=
1&gt;)?(.*)&lt;/h1&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">group -> 2</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I am using the regular expression above to=
extract a headline (h1) from an HTML document</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Courier New"> <B> </B></FONT><B>=
<FONT COLOR=3D"#7F0055" SIZE=3D2 FACE=3D"Courier New">while</FONT></B><FONT=
SIZE=3D2 FACE=3D"Courier New"> </FONT><FONT COLOR=3D"#000000" SIZE=3D2 FAC=
E=3D"Courier New">(mHeadlineRE.match(content,</FONT><FONT SIZE=3D2 FACE=3D"=
Courier New"> </FONT><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Courier New">=
offset))</FONT><FONT SIZE=3D2 FACE=3D"Courier New"> </FONT><FONT COLOR=3D"#=
000000" SIZE=3D2 FACE=3D"Courier New">{</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">For some Html pages this regular expressio=
n works,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">but for some Html pages, it gives the fol=
lowing errors :</FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">[...]</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchNodes(Unknown Source=
)</FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.matchAt(Unknown Source)</=
FONT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.match(Unknown Source)</FO=
NT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at org.apache.regexp.RE.match(Unknown Source)</FO=
NT>
<BR> <FONT COLOR=3D"#0000FF" SIZE=
=3D2 FACE=3D"Courier New">at net.sf.regain.crawler.preparator.html.HtmlCont=
entExtractor.extractHeadlines(HtmlContentExtractor.java:140)</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">on this line :</FONT>
<BR><B><FONT COLOR=3D"#7F0055" SIZE=3D2 FACE=3D"Courier New">while</FONT></=
B><FONT SIZE=3D2 FACE=3D"Courier New"> </FONT><FONT COLOR=3D"#000000" SIZE=
=3D2 FACE=3D"Courier New">(mHeadlineRE.match(content,</FONT><FONT SIZE=3D2 =
FACE=3D"Courier New"> </FONT><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Couri=
er New">offset))</FONT><FONT SIZE=3D2 FACE=3D"Courier New"> </FONT><FONT CO=
LOR=3D"#000000" SIZE=3D2 FACE=3D"Courier New">{</FONT>
</P>
<BR>
<P><SPAN LANG=3D"fr-be"><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Courier Ne=
w">when I use this regex :</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D=
2 FACE=3D"Arial">&lt;h1&gt;(.*)&lt;/h1&gt;  =
; </FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">group 1</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">I never have this er=
ror.</FONT></SPAN>
</P>
<P><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">The problem is that I=
don't even know how to debug this error, that's why I am asking for some h=
elp here.</FONT></SPAN>
</P>
<P><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">Any help is very appr=
eciated, thank u!</FONT></SPAN>
</P>
<BR>
<P><B><SPAN LANG=3D"fr"><WBR><WBR><WBR><WBR><WBR><WBR><WBR><WBR><WBR><WBR><=
WBR><WBR><WBR><WBR><WBR><WBR><FONT COLOR=3D"#006699" SIZE=3D1 FACE=3D"Verda=
na">__________________________________</FONT></SPAN></B>
</P>
<P><B><SPAN LANG=3D"fr"><FONT COLOR=3D"#006699" SIZE=3D1 FACE=3D"Verdana">&=
nbsp; Matthew</FONT></SPAN></B>
</P>
<BR>
<CODE><FONT SIZE=3D3><BR>
<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>
Internet communications are not secure and therefore Fortis Banque Luxembou=
rg S.A. does not accept legal responsibility for the contents of this messa=
ge. The information contained in this e-mail is confidential and may be leg=
ally privileged. It is intended solely for the addressee. If you are not th=
e intended recipient, any disclosure, copying, distribution or any action t=
aken or omitted to be taken in reliance on it, is prohibited and may be unl=
awful. Nothing in the message is capable or intended to create any legally =
binding obligations on either party and it is not intended to provide legal=
advice.<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>
</FONT></CODE>
</BODY>
</HTML>
------_=_NextPart_001_01C7409D.69FC2A4B--
------=_NextPartTM-000-6bbf324e-ad63-4876-8522-f6a1e77899a4
Content-Type: text/plain; charset=us-ascii
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
------=_NextPartTM-000-6bbf324e-ad63-4876-8522-f6a1e77899a4--