backupy icon indicating copy to clipboard operation
backupy copied to clipboard

Support of regex

Open eharvey71 opened this issue 2 years ago • 1 comments

Regex doesn't seem to work with all regex pattern matching operators. I want to exclude directories that contain python virtual environments which have a variety of names. something like /_env/ works but not the /[^.]_env/ below... I want to match on all characters except for a dot (.) in directory names: https://regex101.com/r/kpYkVr/1

backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe /node_modules/ /[^.]_env/ /amplify/

Any help is appreciated. Thanks!

eharvey71 avatar Jul 06 '23 21:07 eharvey71

Backupy doesn't use / as a delimiter for its regexes like most other tools such as sed or awk, so here they are matching the / in the paths. You can omit them or use quotes instead, so either:

backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe node_modules [^.]_env amplify or backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe "node_modules" "[^.]_env" "amplify"

should work.

Hope that helps!

elesiuta avatar Jul 06 '23 23:07 elesiuta