punitpawar has asked for the wisdom of the Perl Monks concerning the following question:
I want to get rid of %20 from the url , so the url should be$str="www.abc%20.com"
I tried doingwww.abc.com
this worked for me. But I want a more generic approach.$str = s/%20//;
output$str =~ s/(\d+|\W+)//g;
Is there a way I can add an exception in my replace command that will say replace all special characters excetp '.' ?wwwabccom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing special characters from a URL
by 1nickt (Canon) on Feb 17, 2016 at 19:19 UTC | |
|
Re: Replacing special characters from a URL
by choroba (Cardinal) on Feb 17, 2016 at 18:45 UTC | |
by punitpawar (Sexton) on Feb 17, 2016 at 19:23 UTC | |
|
Re: Replacing special characters from a URL
by kennethk (Abbot) on Feb 17, 2016 at 22:12 UTC | |
|
Re: Replacing special characters from a URL
by Your Mother (Archbishop) on Feb 17, 2016 at 19:19 UTC |