Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text search loop with 2 known endpoints

Status
Not open for further replies.

RyanPR

Programmer
Mar 28, 2005
2
0
0
US
Hey all! I am creating a program that gets a buddylist for off of a website that the user logs into. In order to get the buddylist, Im using several functions and procedures to clean it up, but my problem is finding the right text to clean. Here is the small snippet for an example:

<TD id=tableb align=left bgColor=#222222><FONT face=Verdana,Arial size=1><A href="usertracker.php?userid=2802">BUDDY NAME GOES HERE</A>

As you can see, its in Html (that's not the problem) but, I need to be able to declare endpoints (TD id=tableb and </A> maybe?) and then have that be the area that gets cleaned up. Then once its done with that, have it loop and continue until no more of those online names are left. Can anyone help me understand how to code this?

Thanks
Ryan
 
Ryan:

Well the end point of a <TD.... is a </TD>, so right there you have a start and an end.

Beyond that, <A href= is a start point and </A> is an endpoint out of which you can extract "BUDDY NAME GOES HERE"

If there are multiple TD /TD pairs, search each one out, and then loop on the A /A pairs until they are all gone, delete that part of the string and start over.



Regards and HTH,
JGS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top