It is Java Script based and uses XReg Exp library for enhanced features.Consult the regular expression documentation or the regular expression solutions to common problems section of this page for examples. You can create range of characters using the hyphen character such as A-Z (A to Z).
This will LEAVE the content of the tags within the string.
The following expression is pretty lenient on the format and should accept 999-999-9999, 9999999999, (999) 999-9999.
Make sure to be in global mode (g flag), case insensitive and to have the dot all option on.
Note that there's just no way to check if the last portion of a path is a file or a directory just by the name alone.
You could try to match for an extension, but there's no requirement for a file to have an extension.