http://www.perlmonks.org?node_id=505963


in reply to regular expression on filenames with absolute path

/\/[-.\w]+(.txt|.doc|.pdf|.vsd|.xls|.xlt|.dot|.pot|.ppt|.mpp)$/
Now they will match. Remember, the character class \w means a-zA-Z0-9_, which does not include ., and -.

This assumes that the general logic is correct. Here, we only got the strings to match, in the spirit of the original regex.