I am trying to substitute a string so a part of this url always goes to the end
google.com/to_the_end/faa/
google.com/to_the_end/faa/fee/
google.com/to_the_end/faa/fee/fii
Using this
(google\.com)\/(to_the_end)\/([a-zA-Z0-9._-]+)
$1/$3/$2
It works for the first example, but I need something a bit more versatile so no matter how many folders it always moves to_the_end
as the last folder in the url string
Desired output
google.com/faa/to_the_end
google.com/faa/fee/to_the_end/
google.com/faa/fee/fii/to_the_end/