Use the replace menu by pressing Ctrl+H, and make sure regular expressions are enabled. Then,
Find (^.*\/).*
and Replace $1
:
https://regex101.com/r/lJ4lF9/12
Alternatively, Find (?m)(^.*\/).*
and Replace $1
: https://regex101.com/r/lJ4lF9/13
Explanation:
Within a capture group, Find the start of the string (^
) followed by anything any number of times (.*
) until the last “https://stackoverflow.com/”, then anything any number of times. Replace with the captured group by referencing it as $1
.
(?m)
4
solved Clean Urls with regular expression