Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Pulling out data between <TD> tags using regular expressions (http://www.velocityreviews.com/forums/t143773-pulling-out-data-between-td-tags-using-regular-expressions.html)

tdmailbox@yahoo.com 05-26-2005 10:05 PM

Pulling out data between <TD> tags using regular expressions
 
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 05-27-2005 12:26 AM

Re: Pulling out data between <TD> tags using regular expressions
 
<TD[^>]*>([^<]*)</TD>

tdmailbox@yahoo.com 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.
>


Chris Uppal 05-27-2005 09:54 AM

Re: Pulling out data between <TD> tags using regular expressions
 
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 05-27-2005 11:01 PM

Re: Pulling out data between <TD> tags using regular expressions
 
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
>
>
>



All times are GMT. The time now is 02:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.