Skip to content

Commit 9ceeca9

Browse files
authored
Fixes #3724 (#3768)
Add a remark that the regular expression searches for an exact match and how to do a search hit.
1 parent 37f06d3 commit 9ceeca9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
<format type="text/markdown"><![CDATA[
3838
3939
## Remarks
40-
You apply the RegularExpressionAttribute attribute to a property when you need to validate values for the property against a regular expression. The regular expression enables you to specify very precisely the format of valid values. The Pattern property contains the regular expression.If the value of the property is null or an empty string (""), the value automatically passes validation for the RegularExpressionAttribute attribute. To validate that the value is not `null` or an empty string, use the **RequiredAttribute** attribute.
40+
You apply the RegularExpressionAttribute attribute to a property when you need to validate values for the property against a regular expression. The regular expression enables you to specify very precisely the format of valid values. The Pattern property contains the regular expression. If the value of the property is null or an empty string (""), the value automatically passes validation for the RegularExpressionAttribute attribute. To validate that the value is not `null` or an empty string, use the **RequiredAttribute** attribute.
41+
42+
The regular expression searches for an exact match, not using `^` before and `$` at the end of the pattern produces the same results as using it. For a search hit, prepend and append the pattern with `.*`.
4143
4244
4345

0 commit comments

Comments
 (0)