Inserting a regex function to check for path validity

Also denies the use of absolute paths