Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Define regex substitution $1,$2,... from a string

by ablanke (Vicar)
on May 24, 2016 at 07:25 UTC ( #1163936=note: print w/replies, xml ) Need Help??


in reply to Define regex substitution $1,$2,... from a string

If your parameter is always an URI, you could use the CPAN Modules URI and File::Basename.
use File::Basename; use URI::Split qw(uri_split uri_join); my @uri = uri_split('https://www.domain.com/aaa/bbb/file.zip'); $uri[3] = 'file='.basename($uri[2]); $uri[2] = 'file_publish'; my $uri = uri_join(@uri); print $uri."\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1163936]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-05-31 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?