In your settings (to enable lookahead) :
"search.usePCRE2": true
Your regex (using a negative lookahead):
blah\.com(?!.*\.htm$)
[Edit] Added the $
if you absolutely want to exclude matches that do not end with the .htm
, not just followed somewhere in the string by .htm
.
From the v1.29 release notes:
It is also now possible to use backreferences and lookahead assertions
in regex searches, by setting "search.usePCRE2": true. This configures
ripgrep to use the PCRE2 regex engine. While PCRE2 supports many other
features, we only support regex expressions that are still valid in
JavaScript, because open editors are still searched using the editor's
JavaScript-based search.
Positive and negative lookaheads and backreferences.
Also note that a previous solution for this has been deprecated:
// Deprecated. Consider "search.usePCRE2" for advanced regex feature support.
// This setting is deprecated and now falls back on "search.usePCRE2".
"search.useRipgrep": false