<p>I'm implementing a class that wraps around an xml document with a very strictly defined schema.  I don't control the schema.  </p>

<p>One of the properties in the class is for an element value that the schema indicates must match a certain regular expression.  In the setter for the property, if a string doesn't match the expression I'm throwing an exception.</p>

<p>My question is, how can I better communicate to users of my class the requirements for this field?  Is there an attribute I can use?  Xml comments (so it shows up in intellisense)?  Should I do something other than thrown an exception?  What other options do I have?</p>

Document it in the XML comments, and throw an exception.  Make the message explicit:
```
```
Element <elementname> must match /regex/
```
```