You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to watch all C files but ignore Emacs lock files. E.g.
file.c # should match
.#file.c # should not match
I've tried various patterns, but as far as I could figure out by toying with https://www.regextester.com, the following should match
fswatch -e '.*' -i '^(?!\.#).*$' .
But I can't get that to work. I can't find a pointer to the exact regex specification that fswatch uses. (Actually I don't know if negative lookahead is considered "extended", but adding -E causes compilation of regex error.)
The text was updated successfully, but these errors were encountered:
The regular expression ^[^.]+\.c$ means "A string beginning with one or more characters that are not ., followed by a ., followed by c ending the string".
This should work fine for files that are in the top-level directory. If you're hoping to catch C files in subdirectories, you'll have to make the include pattern more clever to account for that.
Lookaheads and lookbehinds can be handy for some situations, but support for them varies considerably from one regex engine to another. It's better not to rely on them unless absolutely necessary.
I'm looking to watch all C files but ignore Emacs lock files. E.g.
I've tried various patterns, but as far as I could figure out by toying with https://www.regextester.com, the following should match
But I can't get that to work. I can't find a pointer to the exact regex specification that fswatch uses. (Actually I don't know if negative lookahead is considered "extended", but adding
-E
causes compilation of regex error.)The text was updated successfully, but these errors were encountered: