Traded bash regex for more basic checks, to play nicer with cygwin