0

I would like to use notepad++ to remove all text after the / in a domain url.
I have a huge list of domains and some of them have a specific page or address after the domain name. I want to strip the list down to just the domains and note specific pages. Hope that makes sense.

EXAMPLE:

http://www.domain.com/navigation/departmentcontacts.shtml

I want to remove everything after the http://www.domain.com so only the domain is left.

The list is not all .com either its .edu, .net, .com, .net, etc.

I'm not sure how to go about doing this. I'm unfamiliar with regular expressions and need some guidance please.

Thank you very much!

1 Answer 1

2

enter image description here
(\.\w+)/.* means: a dot, followed by multiple chars, followed by a slash, then followed by anything.
Replace with \1 means to replace matched string with the string in the 1st group of parenthesis.

2
  • You my friend are amazing! +1 have a great holiday. Worked perfect.
    – ChadF
    Commented Dec 11, 2014 at 1:43
  • You might as well mark this answer as the correct answer by clicking on the TICK button. :) Commented Dec 11, 2014 at 2:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .