Fixed a bug in the reference regex.