I have a string that looks like this: "http://www.example.com/hello/world/ab/c/d.html" (or this: "http://www.example.com/hello/world/ab/d.html")
I want to extract the content between http://www.example.com/hello/world/ and d.html. What should the generic regular expression be?
You probably want
This (complicated-looking) expression skips the domain and the first two path components, then extracts all the bits before the final path component.
Example: