searching only for # or : caused crashes

Bug: 66151
Change-Id: I8ebf03ab683fc16bee7cb1468c58e15227a71cf8