Merge pull request #2078 from DimitriPapadopoulos/test_dictionary_re

Simpler regex and consistent use in tests