Given the full path to a file, how do I get just the path without the filename?

Posted by Zerobu on Stack Overflow See other posts from Stack Overflow or by Zerobu
Published on 2010-04-06T01:28:08Z Indexed on 2010/04/06 1:43 UTC
Read the original article Hit count: 321

Filed under:
|

Hello, Suppose I have a path in a string called '/home/user/directory/HelloWorld.txt'. I would like to remove the HelloWorld.txt, and end up with '/home/user/directory'. What regex would I need.

© Stack Overflow or respective owner

Related posts about regex

Related posts about perl