I am trying to create a find command to find the files that git create when there is a conflicting rebase/merge.
.//Tools/tri_tri_intersect.h
.//Tools/tri_tri_intersect.cpp
.//Collisions/PBD/FiltersUtils_BACKUP_450361.cpp
.//Collisions/PBD/FiltersUtils_BASE_450361.cpp
.//Collisions/PBD/FiltersUtils_LOCAL_450361.cpp
.//Collisions/PBD/FiltersUtils_REMOTE_450361.cpp
From this list of files, I want a find command to select the last 4, the ones with BACKUP, LOCAL, REMOTE, BASE.
I have tried this find . -type f -regex '.+_((BACKUP)|(BASE)|(LOCAL)|(REMOTE))_.*' but doesn't work.
What would be the correct regex?
-regextype egrepto your command.emacs- which supports an ERE-style+quantifier, but grouping and alternation must be escaped like POSIX BRE:'.+_\(BACKUP\|BASE\|LOCAL\|REMOTE\)_.*'. See also Confusion with Linux find regexfind . -type f \( -name '*_BACKUP_*' -o -name '*_BASE_*' -o -name '*_LOCAL_*' -o -name '*_REMOTE_*' \)