Question: I want to convert

```
http://website.com/cat/movie/nameofmovie.html

```

to this

```
http://website.com/cat/movie

```

So I have tried `[/].*(html)` But this applied from first `/` char, Is there any way to specify 5th `/` in the line?
Is there any method to inverse replace?

Answer: 
Try to replace directly `/\w+\.html` with nothing.
You can replace `/[^/]+(\s+|$)` with nothing. If you have to filter with hmtl files, just add the extension like this: `/[^/]+\.html(\s+|$)`.