I tried this yesterday hoping it would work, but apparently not. In the end I had to resort to a cludge using a hash table with regex as items and name mappings as data.