isValidPath function
Implementation
bool isValidPath(String path) {
if (!RegExp(pathRegex).hasMatch(path)) {
return false;
}
return !path
.split("/")
.sublist(1)
.map(replaceDerive)
.any((e) => int.tryParse(e) == null);
}