logo       

Re: [solved] How to cut off parts of an url: msg#00333

perl-beginners

Subject: Re: [solved] How to cut off parts of an url

Hello,

the solution from John W. Krahn 'did the trick':
s!^.*/something_constant/[^/]+/!!;

Thank's a lot to John and Chas

Peter

> I've to cut off parts of an url like
> '/something_variable_1/something_constant/something_variable_2/something_va
>riable_3/filename'
>
> The result should be 'something_variable_3/filename'
>
> To cut off the part '/something_variable_1/something_constant' works with
> the regular expression 's/^.*\/something_constant\///'
>
> But I dont manage to cut of the 'something_variable_2' part. I tried
> combinations of .*?{}() but the result is either no cut
> ('something_variable_2/something_variable_3/filename') or only the
> filename.

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
http://learn.perl.org/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise