Regex for all strings not containing a string? [duplicate] December 18, 2023 by Tarik You can use negative lookbehind, e.g.: .*(?<!\.config)$ This matches all strings except those that end with “.config”