Not my area of expertise but I have only seen it used in this context:
#region Data field attributes
[ImmutableFieldId("c68429ed-74c3-4ad6-afee-b6364f80f224")]
[StoreFieldType(PhysicalStoreFieldType.String, 64)]
[LazyFunctionProviedProperty("<f:function xmlns:f=\"http://www.composite.net/ns/function/1.0\" name=\"Composite.Ut" +
"ils.Validation.RegularExpressionValidation\">\r\n <f:param name=\"pattern\" value=\"{put in your validation regex here}" +
"\" />\r\n</f:function>")]
[NotNullValidator()]
[FieldPosition(0)]
[StringSizeValidator(0, 64)]
[DefaultFieldStringValue("")]
#endregion
string Title { get; set; }
I assume thats the intention of the RegularExpressionValidation function you found, and it properly takes some work to get what you trying to work.