My application creates a SharePoint site and an Active Directory group from user input. Special characters that are mentioned in http://www.webmonkey.com/reference/Special_Characters becomes a big problem in my application. Application creates group names differently and application can’t access them from name property. I want the user input to be validated from a regular expression for these characters. I googled in and found some good regex sampler and testers but they won’t solve my problem. So can anybody suggest a regex for disallowing special characters which is a problem for Active Directory object names?
P.S. Application users may enter Turkish inputs, so regex should also allow Turkish characters like ‘ç’, ‘ş’, ‘ö’
You should start with something like this:
This will match:
\p{L}: any kind of letter from any language\p{N}: any kind of numeric character in any script\p{P}: any kind of punctuation character.When you query your AD, you must to escape some special characters, described here: Creating a Query Filter
ASCII Escape sequence character substitute * "\2a" ( "\28" ) "\29" \ "\5c" NUL "\00"