I have a file with a number of urls in the form:
http://www.edu-factory.org/wp/about/
I'd like to extract the sitehost of the url and append it to the end of the line:
http://www.edu-factory.org/wp/about/ www.edu-factory.org
Any idea how to do that?
|
I have a file with a number of urls in the form: http://www.edu-factory.org/wp/about/ I'd like to extract the sitehost of the url and append it to the end of the line: http://www.edu-factory.org/wp/about/ www.edu-factory.org Any idea how to do that?
| |||
|
feedback
|
|
One way to do that:
Explanation:
Edit: You could sorten that to:
The ampersand outputs the whole matched string which includes the whole line since the regex begins and ends with | |||||
feedback
|