![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Sep 2002
Location: Nashville, TN
Posts: 104
|
Regular Expression Help
I need to remove style content code from within <td> tags on hundreds of html pages. I figure the easiest way to do this would be a regular expression and a text editor.
So, anyone here know how to write a regular expression to turn this... <td height="15" class="xl24" style="height:11.25pt"> Into this... <td> Thanks
__________________
http://www.xRag.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
Maybe this can help you: http://www.htmlworkshop.com/srhtml98.html
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Aug 2003
Location: Portland, Oregon
Posts: 4,541
|
Quote:
simple the hardest bit is you may have to debug some of my escaping... in VI: %s/\<td height\=\"15\" class\=\"xl24\" style\=\"height:11.25pt\"\>/\<td\>/g
__________________
Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Aug 2003
Location: Portland, Oregon
Posts: 4,541
|
you may or may not need to escape the colon and period... plus some of the <> may not need to be escaped although doing so shouldnt hurt the expression. hope this helps, im running out the door to LA or id test it for ya! ciao!
__________________
Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
G F Y not
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
|
Is it just <TD> tags? If so I can write something real quick to do it for you
__________________
![]() TGPFactory Full TGP Design & Installation Services ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com See who I am at AdultWhosWho.com! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Sep 2002
Location: Nashville, TN
Posts: 104
|
Quote:
Actually, the contents of the tags contain many, many different variations... so that won't work. I need to be able to clear out *anything* that is within the tag.
__________________
http://www.xRag.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Sep 2002
Location: Nashville, TN
Posts: 104
|
Quote:
__________________
http://www.xRag.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Aug 2003
Location: Portland, Oregon
Posts: 4,541
|
shit well last tidbit before I leave, the character $ means "end of", do a little reading on your regexes will show you how to do delete from <td -through end of line or statement and close it off with a >.
%s means match the following string %s/shit/fuck/g means replace all instances of shit with fuck. ^ is beginning of doc or line $ is end. good luck wish i had more time! ciao
__________________
Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Sep 2002
Location: Nashville, TN
Posts: 104
|
Got something to work:
Search for this: <td[^>]*> Replace with this: <td> This was done in TextPad.
__________________
http://www.xRag.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
G F Y not
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
|
http://www.pimpts.com/dl/tdslicer.exe
Drag and drop files from Windows Explorer onto this. File is saved as the original but appended with _new.. ie: original - c:\file.html new - c:\file_new.html Only parses .html and .htm files
__________________
![]() TGPFactory Full TGP Design & Installation Services ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com See who I am at AdultWhosWho.com! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Sep 2002
Location: Nashville, TN
Posts: 104
|
Quote:
I used it on a few of the files and it worked perfectly. I used TextPad for the rest. Seemed to do the job faster. Thanks again for helping me with this.
__________________
http://www.xRag.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |