Don't break when reference names contain []

Authored by MaxSem on Fri, Nov 10, 1:21 AM.

Description

Don't break when reference names contain []

Bug: T29694
Bug: T179544

Depends-On: I189bdefbc9034cf8d221a89d7158195de1c0fa6c
Change-Id: Iec3439f76ecc2a3543b30b35f8735c92b0cfb711