Search commands in history with discontinuous keywords

If you are just looking to find the line (to jog your memory) you could just grep for the part of the command you remember:

history | grep "substring"

Bash only has a simple string search, as far as I can see.

Consider switching to zsh, which has a history wildcard search. history-incremental-pattern-search-backward and history-incremental-pattern-search-forward aren't bound to keys by default, but you can bind them:

bindkey '^X^R' history-incremental-pattern-search-backward
bindkey '^X^S' history-incremental-pattern-search-forward

Then type Ctrl+X Ctrl+R ^c*my.