improve "^ref:" match