Validates filenames using given RegExp