private void CheckAutoblind(JProperty iProperty) { //get all dependent properties belonging to AutoBlind namespace (starting with as_*) var lDescendants = iProperty.Descendants().OfType<JProperty>().Where(p => p.Name.StartsWith("as_")); //create lookup with defined item names (as_item_([A-Z].*)) var lLookup = lDescendants.Where(p => p.Name.StartsWith("as_item_")).Select(p => p.Name.Substring(8)); //now we check existence Regex searchTerm = new Regex(@"as_[a-z]*_([A-Z].*)"); foreach (var lProp in lDescendants) { var lGroups = searchTerm.Match(lProp.Name).Groups; if (lGroups.Count > 1 && !lLookup.Contains(lGroups[1].Value)) { Util.gMessages.AppendLine(string.Format("AutoBlind reference not found: as_item_{0}, referenced in File: {1}, Path: {2}", lGroups[1].Value, Util.FileNameToString(mCurrentFileName), lProp.Path)); } } }