Last active
August 29, 2015 13:58
-
-
Save stevenschobert/10023051 to your computer and use it in GitHub Desktop.
My take on a filepath testing regular experession. Requires a relative or absolute path, and an extension. Excludes plain filenames.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^[\.+]*\/+.*\.[a-zA-Z0-9]+$ | |
# Matches | |
/Users/stevenschobert/Documents/project/tmp/tmp-8205.txt | |
../somepath.txt | |
./sompat/h.d | |
./Something with spaces/word.txt | |
# Does not match | |
../sompath | |
something.txt | |
some other /word.txt | |
.some other /word.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment