![]() |
![]() |
![]() |
||||
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 |
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 |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Guest
Posts: n/a
|
Well, assuming the string ends with a newline character...
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
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 -- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Dec 2001
Location: NY, NY, USA
Posts: 131
|
$url =~ s/.*?(\.htm.*)/$1/i;
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Dec 2001
Location: NY, NY, USA
Posts: 131
|
Let me guess, you favorite kind of string is cheese?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Jul 2001
Location: Living Off The Grid
Posts: 3,022
|
Indeed.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Jul 2001
Location: Living Off The Grid
Posts: 3,022
|
and my favorite platform is dais
|
![]() |
![]() ![]() ![]() ![]() ![]() |