Is it possible to create a regexp that excludes a string? For example, I want to create a regexp that accepts a set of strings with *.*helm.**
except a few ones such as *helm help*
. It means, *helm help*
should be excluded. I want this regexp functionality because I set display-buffer-alist
to position Helm windows where I like it to be:
(add-to-list 'display-buffer-alist `("*.*helm.**"
(display-buffer-in-side-window)
(inhibit-same-window . t)
(window-height . 0.4)))
However, doing so would prevent a Helm buffer by default displayed in fullscreen, like *helm help*
buffer.
\\*
, or enclosed within square brackets[*]
. TypeM-x re-builder RET
and experiment a bit with samples in the buffer above. If you modify your question with a few real real life examples with actual strings you wish to match, I or someone else can take a stab at it. By placing incorrect regexp in your question, it is difficult to know exactly what you want to match. The carrot^
within square brackets negates.help
itself, while I want to exclude it.display-buffer-alist
and it contains custom functions that handle a variety of different situations. I have a few different variables with lists of regexp matching certain buffers, and a function that goes through the lists comparing the current buffer to be displayed with those in the list -- different action is taken depending upon the regexp matched. There is an example function that works out of the box.[^e]
, but that's really an abbreviation for specifying any char excepte
.) It sounds like you are not looking for a regexp that excludes a file, but you are instead looking for some way to exclude a file from display or from some other handling. If so, you should edit your question, including the title and the tags, to clarify it. It sounds like your question is really about how to usedisplay-buffer-alist
.defadvice
thehelm-help
function to exclude itself. So, yes, I won't use such regexp in this case since it's not supported.