Shouldn't `basedir` be escape if it's passed to `new RegExp()`?