improving regex for version parsing, trying out yet another deletedir function