Regular expression for removing the page part of a url
Can someone show me a regex that will remove the page part from a string.
My strings are either
/section/
/section/page.html
/section/subsection/page.html
I need a regexp that would return
/section/
/section/
/section/su开发者_运维技巧bsection/
You can assume the file ext is always .html and the strings are relative (no http://host:port)
Thanks!
I think you're looking for:
/(.*/)+
精彩评论