|
-
Sep 11th, 2006, 07:42 AM
#1
Thread Starter
New Member
[JAVA] Find and replace
When I was making a picture site, I ran to the next problem:
When I host my pictures through a free host like imageshack, I get a heap of HTML code. This code places all the image behind eachother which isn't good for the layout of my site. That's why I'm busy with a very simple applet that changes this html. The applet has to do this:
1. the original code needs to be pasted in a first textfield
2. find and remove "<p>" and "</p>"
3. find "<a href=" and replace by "<td><a href="
4. find "alt="" /></a>" and replace by "alt="" /></a></td>"
5. find "<td>" and the 3 time, replace by "<tr><td>"
6. find "</td>" and the 3 time, replace by "</tr></td>"
7. find "<tr>" and the 3 time, replace by "<table border="0"><tbody><tr>"
8. find "</tr>" and the 3 time, replace by "</tr></tbody></table>{mospagebreak}<br />"
9. give the output in a second textfield, ready to copy/past on the site.
Like this the pictures get organised in a table of 3 on 3 and after each table there is a code that generates a new page. All the normal find and replace i can do, but it's the ones that only replace the third time that i can't find. I've been looking on google and in the java documentation but I can't find anything useful.
For you guys this must be a peace of cake, that's why I'm asking it here.
Tnx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|