adapted from: http://oddhypothesis.blogspot.be/2012/05/regex-named-capture-in-r.html

match_path(pattern, path, ...)

Arguments

pattern

regex pattern

path

the path to test the regex pattern against

...

arguments passed to regexpr