Open mobileink opened 3 years ago
This works for me:
fswatch -E -i '\.mli?$' -e '.*' .
Note the -E
to switch into "extended" regexp mode.
A general tip for writing regexps: putting .*
at the start or end of a pattern doesn't change anything, unless you are using a function that specifically anchors at the beginning or end of a string, or only matches against the entire string.
For example, in Python, re.match() only matches at the beginning of a string, but re.search() matches anywhere in the string. Most of the time unless you're told otherwise, a regexp will match anywhere in the string. In fswatch
, it definitely matches anywhere in the string.
Hi,
I need to watch
.*\.ml$
and.*\.mli$
files. I think regex `.*.ml.?$" ought to work, but it doesn't, so I need to add two filters. Should '?' work? (This is using the C API of libfswatch.)Thanks