Simplify tag detector for searchbar

thx @ianstormtaylor