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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-03-2002, 05:30 PM   #1
X37375787
Guest
 
Posts: n/a
In need of help with regular expressions



Assuming I have a string looking like this:

http://www.rebelcutie.com/gal/ox7/clean.htm">Squeaky Clean Teen</a><br>

and I would like to get rid of the part behind the .htm(l) - how does the regular expression look for it ?

Thanks
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 05:31 PM   #2
X37375787
Guest
 
Posts: n/a
Well, assuming the string ends with a newline character...
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 06:27 PM   #3
TheFLY
So Fucking Banned
 
Join Date: Jan 2001
Location: http://www.thefly.net/ --- Quit your job and live off steady traffic.
Posts: 11,856
Are you using Perl, PHP, or... ?

I'm pretty sure PHP has built in functions to extract URL's --
TheFLY is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 09:05 PM   #4
Nbritte
Confirmed User
 
Join Date: Sep 2001
Location: Kentucky USA
Posts: 689
This might work in perl assuming that $newurl is the results of the extraction and $oldurl is the original line

I didnt test it but if it dosnt work let me know and I will check into it for you

$newurl = substr ($oldurl,index(lc($oldurl),"http://"),(index($oldurl,"\">") - index(lc($url),"http://"))

Brian

[email protected]
__________________

SexyCityCash gets in Bed with PornoDan
Nbritte is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 09:54 PM   #5
willow
Confirmed User
 
Join Date: Dec 2001
Location: NY, NY, USA
Posts: 131
$url =~ s/.*?(\.htm.*)/$1/i;
willow is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 09:59 PM   #6
Rocky
Confirmed User
 
Join Date: Jul 2001
Location: Living Off The Grid
Posts: 3,022
eat shit and die mutha fucker

that's a regular expression i use everyday
Rocky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 10:12 PM   #7
willow
Confirmed User
 
Join Date: Dec 2001
Location: NY, NY, USA
Posts: 131
Let me guess, you favorite kind of string is cheese?
willow is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 10:22 PM   #8
Rocky
Confirmed User
 
Join Date: Jul 2001
Location: Living Off The Grid
Posts: 3,022
Indeed.
Rocky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2002, 10:23 PM   #9
Rocky
Confirmed User
 
Join Date: Jul 2001
Location: Living Off The Grid
Posts: 3,022
and my favorite platform is dais
Rocky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.