Escaping reserved words
问题 Sitecore provides a way of escaping words within a Sitecore query that contain characters that they don't like. Such characters include hyphens and spaces. In the interest of simplifying my life, I wrote a simple helper function that would escape every part of a Sitecore query, and it worked fine for a while: public static string EscapePath(string path){ return Regex.Replace(path, @"([^/]+)", "#$1#").Replace("#*#", "*"); } (the Replace("#*#","*") is in there because Sitecore doesn't like it