search: only omit ending `.*` for parsing include pattern
Created by: unknwon
This is a hacky but working patch that works with both #9146 (closed) and #4166 (closed).
I do not think this is the right fix but to reveal the problem we have in hand.