![]() |
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 |
Well, assuming the string ends with a newline character...
|
Are you using Perl, PHP, or... ?
I'm pretty sure PHP has built in functions to extract URL's -- |
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] |
$url =~ s/.*?(\.htm.*)/$1/i;
|
eat shit and die mutha fucker
that's a regular expression i use everyday :winkwink: |
Let me guess, you favorite kind of string is cheese?
|
Indeed.
|
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