The problem is I might have many “foo” entries to check against. I already had a check going on in the relevance, listing all the valid “foo”'s to check against but it got ugly.
In addition, I could not rely on the data that was given to me and that data is subject to change with no notification.
You can at least just check the syntax. This will make sure the value starts with 2 backslashes followed by at least 1 character, followed by 1 backslash, followed by at least 1 character, and no trailing whitespace: