Regex to match substring of file path
I am trying to write a regular expression in Perl that matches a specific part of the file path. Input string: /usr/local/bin/mybinary Output it has to match to: /usr/local/bin My regular expression is: (\ /.*\ /) It is matching /usr/local/bin/, but the / after bin should be removed.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.