Home : General : Perl Programming :

General: Perl Programming: Re: [scorpioncapital] how to do this simple regex?: Edit Log

Here is the list of edits for this post
Re: [scorpioncapital] how to do this simple regex?
Try;

my $relative;
$var =~ m/^http:\/\/(.+?)\/(.+?)/i and $relative = $2;

That should assign the bit after the first extention to $relative. Untested, but it looks like it should work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Sep 11, 2003, 12:38 PM

Edit Log: