Introduction

Have you ever dealt with regular expression in RCDC? I had to correct the email address format AND block internal domains on new objects via the create RCDC due to the nature of the object (external contacts). Who wants to open the portal to you know where in theyre organization? That being said, let's limit the room for "human error".

Option A (Quickest)

Use the RegularExpression property that is referenced in the attribute binding.

Example 1

"<my:Property my:Name="RegularExpression" my:Value="{Binding Source=schema, Path=REPLACEWITHATTRIBUTENAME.StringRegex}"/>"

Notes

The limit on this field is 128 characters, it takes precedence over the RCDC document itself. Make sure to perform an IIS reset after your update.

Option B (Use this for your more advanced expression)

Use the RegularExpression property on the attribute binding via the Portal.

 

Example 1

Use this to block special characters in attributes like first, last, or displayname.

<my:Property my:Name="RegularExpression" my:Value="^([a-zA-Z0-9 _-]+)$"/> 

Example 2

This works great to block the prefix of domains or words (bad word filter) pending your business requirement. Below example will show invalid syntax when someone tries to enter either of the following entries.

<my:Property my:Name="RegularExpression" my:Value="(?!@(google.com|microsoft.com|sheldonjaquay.com)$)"(||)$)"/ 

Example 3

This is an upgrade to the out of the box regular expression for the e-mail address.

<my:Property my:Name="RegularExpression" my:Value="^[0-9a-zA-Z]+([0-9a-zA-Z]*[-._+])*[!#-'*+/-9=?A-Z^-~-]+@[0-9a-zA-Z]+([-.][0-9a-zA-Z]+)*([0-9a-zA-Z]*[.])[a-zA-Z]{2,6}$"/>  

Limitations

There are many limitations to this; the current characters are not allowed which are used and work in regular expression but not in XML, all 3  & > <. 

You may run into some of the example errors;

Character ‘<’, hexadecimal value 0x3c is illegal in XML attribute values 

 

Illegal syntax. Expecting valid start name character.

 

Entity ‘’ not defined. (My example was %)

 

 

Option C: Advanced view

This is for the regular expression that contains & or > or <, and/or is longer than 128 characters. Use the String Regular Expression property on the attribute that is bind to the object via the Portal under the “Advanced View”. span style="text-decoration: underline;">/IdentityManagement/aspx/schema/AllBindingDescriptions.aspx

   

Notes

This is the best option in my opinion, I am using over 2600 characters in my regular expression with 0 issues. I can also use all 3 characters limited in the RCDC document. This is a pretty big deal and I hope that others take note!