GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   In need of help with regular expressions (https://gfy.com/showthread.php?t=49914)

X37375787 02-03-2002 05:30 PM

In need of help with regular expressions
 
:helpme

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

X37375787 02-03-2002 05:31 PM

Well, assuming the string ends with a newline character...

TheFLY 02-03-2002 06:27 PM

Are you using Perl, PHP, or... ?

I'm pretty sure PHP has built in functions to extract URL's --

Nbritte 02-03-2002 09:05 PM

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]

willow 02-03-2002 09:54 PM

$url =~ s/.*?(\.htm.*)/$1/i;

Rocky 02-03-2002 09:59 PM

eat shit and die mutha fucker

that's a regular expression i use everyday
:winkwink:

willow 02-03-2002 10:12 PM

Let me guess, you favorite kind of string is cheese?

Rocky 02-03-2002 10:22 PM

Indeed.

Rocky 02-03-2002 10:23 PM

and my favorite platform is dais


All times are GMT -7. The time now is 02:10 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123