Skip to content

Commit c93fcbf

Browse files
committed
Add example regex using membership inversion
This is useful when wanting to run tests for all pkgs except for those pkgs matching a desired pattern.
1 parent e4475d5 commit c93fcbf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/dev.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ where `-F` indicates to search for a fixed string. To search using a regular exp
9393

9494
### Find and Replace
9595

96+
#### Exclusion
97+
98+
To exclude paths when using `find`, use membership inversion
99+
100+
```bash
101+
$ find -type f -name foo.txt -regextype posix-extended -regex '.*/foo/([^b]+|(b([^a]|$)|ba([^r]|$)))+/.*'
102+
```
103+
104+
Note that, when passing the above regular expression through Make, the `$` symbol needs to be escaped (e.g., `$$`).
105+
96106
#### Multi-file
97107

98108
To perform a multi-file find and replace,

0 commit comments

Comments
 (0)