Closed ParthJadhav closed 2 years ago
let search: Vec<String> = SearchBuilder::default() .location("/System/") .search_input("Syste") .depth(1) .ignore_case() .build() .collect();
This will return everything contained in /System/ directory because the Regex will be matched with the path input i.e /System/ and return everything.
/System/
This could be solved by adding: .split("/").last().unwrap() to path
.split("/").last().unwrap()
path
reg_exp.is_match(&path.split("/").last().unwrap())
@TheAwiteb , Is there a better way to do this? Or are there any implications using this approach ?
Yes, we can use Path::file_name. Assign it to me, i'll solve it
Path::file_name
Okay @TheAwiteb , Thanks a lot
This will return everything contained in
/System/
directory because the Regex will be matched with the path input i.e /System/ and return everything.This could be solved by adding:
.split("/").last().unwrap()
topath
@TheAwiteb , Is there a better way to do this? Or are there any implications using this approach ?