move indexOf to regex to support default illegal title characters