Auto add regex at some window/menu

can you make it so any window that add a regex to search clear it after are make any search clear when you chnage area there can also be a option for it for these who like it on these who don’t.