Pulling out data between <TD> tags using regular expressions

Discussion in 'Java' started by tdmailbox@yahoo.com, May 26, 2005.

  1. Guest

    If I had this tag and wanted to return 123 how would I do it? I have
    tried countless methods but can not get the only the 123 without the
    <TD> tags

    <TD class=tblform3 id=L_listing width=23>123</TD>

    After 3 hours I am giving up and asking the experts.
    , May 26, 2005
    #1
    1. Advertising

  2. Wibble Guest

    <TD[^>]*>([^<]*)</TD>

    wrote:
    > If I had this tag and wanted to return 123 how would I do it? I have
    > tried countless methods but can not get the only the 123 without the
    > <TD> tags
    >
    > <TD class=tblform3 id=L_listing width=23>123</TD>
    >
    > After 3 hours I am giving up and asking the experts.
    >
    Wibble, May 27, 2005
    #2
    1. Advertising

  3. Chris Uppal Guest

    Wibble top-posted:
    > <TD[^>]*>([^<]*)</TD>
    >
    > > If I had this tag and wanted to return 123 how would I do it? I have
    > > tried countless methods but can not get the only the 123 without the
    > > <TD> tags
    > >
    > > <TD class=tblform3 id=L_listing width=23>123</TD>



    Won't work if the included text has it's own tags.

    I doubt whether regexps are the right tool for this job. (Personally, I doubt
    whether they are ever the right tool for any job).

    -- chris
    Chris Uppal, May 27, 2005
    #3
  4. Wibble Guest

    The specification didnt include nested tags.

    Java is full of cool stuff that you have to rewrite if you
    actually care.

    Chris Uppal wrote:
    > Wibble top-posted:
    >
    >><TD[^>]*>([^<]*)</TD>
    >>
    >>>If I had this tag and wanted to return 123 how would I do it? I have
    >>>tried countless methods but can not get the only the 123 without the
    >>><TD> tags
    >>>
    >>><TD class=tblform3 id=L_listing width=23>123</TD>

    >
    >
    >
    > Won't work if the included text has it's own tags.
    >
    > I doubt whether regexps are the right tool for this job. (Personally, I doubt
    > whether they are ever the right tool for any job).
    >
    > -- chris
    >
    >
    >
    Wibble, May 28, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Douglas
    Replies:
    0
    Views:
    600
    Jay Douglas
    Aug 15, 2003
  2. Mudcat
    Replies:
    2
    Views:
    981
    Mudcat
    Dec 14, 2008
  3. Replies:
    4
    Views:
    584
    J├╝rgen Exner
    Apr 12, 2005
  4. Replies:
    20
    Views:
    702
  5. Noman Shapiro
    Replies:
    0
    Views:
    232
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page