Variable substitution in a plist – can I define a value once and reuse it in a manually maintained plist?-Collection of common programming errors
How about instead of having one property and having to determine when to make a substitution, you have two properties. One will be "regex", which you are currently using, the other will be a "namedRegex". In another section of your plist, you can define all the named regular expression.
"namedRegexes" = {
"regex1" = ".*";
"regex2" = "[0-9]*";
.
}
.
"objects" = {
"object1" = {
"regex" = "[A-Z]*";
.
};
"object2" = {
"namedRegex" = "regex1";
.
}
.
}
At runtime, you will need to look for a regex, if one does not exist, then look for a namedRegex. If there is a namedRegex, then lookup that name in namedRegexes.