Allow more characters before and after the actual reference. Also use the correct matching method during testing.