@ImDbg: I disagree. Microsoft distributes SqlTypes.xsd from 2004 which contains what I'll call "official Microsoft" regexes for all of the other SqlServer datatypes, and I do not see any reason why they should fail to provide additional "official" regexes for the newer SqlServer datatypes including hierarchyid. Microsoft are you listening?
@JohnGrove: It would be nice to have an "approved" regex fully compatible with the hierarchyid datatype so that it's possible to go the full round trip from a SqlHierarchyid.ToString, perhaps manipulate and/or create a new id in string format, and then parse(theString) back to the hierarchyid in binary format. In this setting, it would be great to have the proper regex to test the string before parsing it back to the binary format.
Sure the regex should match a series of /{field}/{field}/.... where each {field} is {integer.integer.integer....} but under what additional constraints? As long as Microsoft is the organization responsible for declaring and defining the underlying datatype, they will have to be the ones to define an official regex.
Meanwhile, we can work with our own unofficial regexes. However, I just thought that it would be useful to ask if Microsoft had done an official one or not. And if they have not, then they should!!! |