Taking two different statements.
Melvin Mah <[email protected]> Mon, 20 Nov 2006 02:40:12 -0800 (PST)
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
I have a list of ten results that I would like to extract from the source page to be used in my XML connector. The scenario is this ( in a page of 10 entries) : Entries 1,2,3,5,8,9,10 have normal statements. Entries 4,6 and 7 have statements but with keywords highlighted in bold. I want to get all the statements in one go, but I'm not sure what is the best regex for this scenario. I'm using a Perl5 regex for this. If I am to get normal statements, I would get this regex: TI: </td>(.*)\n([ \t]*)<td valign="top"><a>(.[^>]*)</a></td> For statements that have bold highlighted words, it would be: TI: </td>(.*)\n([ \t]*)<td valign="top"><a>([^<]*) <font color="#990000">(<b>([^>]*)</b></font>([^>]*)</a>) I want to get all the statements together, so i am wondering what is the best regexp for this? Thanks --- "Daniel F. Savarese" <[email protected]> wrote: > > In message > <[email protected]>, > Melvin Mah > writes: > >I managed to get 750,000 but I do not want the > commas > >I need to remove those. > > > >Is there any syntax that I need to add /change to > the > >current regex? > > You're going to have to do a postprocessing > substitution pass because > you don't know exactly how many commas are going to > be in any given > piece of input. Otherwise, you could capture the > numbers surrounding > the commas and concatenate them. > > daniel > > -#-#-#-#-| Sleep and The Traveller |-#-#-#-#-#-#-#- > http://www.savarese.org/ > In distant lands, I hear the call of my home. # > s a v a r e s e > Yet my work is not done. My journey's just begun.- > software research > -- http://www.sleepandthetraveller.com/ # > http://www.savarese.com/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [email protected] > For additional commands, e-mail: > [email protected] > > ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $420k for $1,399/mo. Calculate new payment! www.LowerMyBills.com/lre