Inserting a regex function to check for path validity

Also denies the use of absolute paths
Some extra, minor modifications