I need some help: looking for a way to remove everything after the nth occurrence (most likely 4th or 5th) of \"/\" in a hyperlink. For instance, if I have
Using Notepad++:
^((?:[^/]*/){5}).*$
$1
. matches newline
Explanation:
^ : begining of lin
( : start group 1
(?: : start non capture group
[^/]* : 0 or more any character that is not a slash
/ : a slash
){5} : group must appear 5 times
) : end group 1
.* : 0 or more any character
$ : end of line
Replacement:
$1 : content of group 1 (ie. everything before the 5th slash)
Result for given example:
https://www.forbes.com/forbes/welcome/