Skip to content

Commit 3d0c3af

Browse files
jasonleenaylorRick-Anderson
authored andcommitted
Add note on RegularExpression attribute validation (dotnet#15984)
* Add note on RegularExpression attribute validation This note will help inform developers of the limitations. * Update validation.md * Update validation.md * Update validation.md * Update validation.md * Update validation.md * Update validation.md * Update validation.md
1 parent 9563a05 commit 3d0c3af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aspnetcore/mvc/models/validation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: rick-anderson
44
description: Learn about model validation in ASP.NET Core MVC and Razor Pages.
55
ms.author: riande
66
ms.custom: mvc
7-
ms.date: 12/05/2019
7+
ms.date: 12/15/2019
88
uid: mvc/models/validation
99
---
1010

@@ -419,6 +419,8 @@ Built-in validation attributes include:
419419
* `[Url]`: Validates that the property has a URL format.
420420
* `[Remote]`: Validates input on the client by calling an action method on the server. See [`[Remote]` attribute](#remote-attribute) for details about this attribute's behavior.
421421

422+
When using the `[RegularExpression]` attribute with client-side validation, the regex is executed in JavaScript on the client. This means [ECMAScript](/dotnet/standard/base-types/regular-expression-options#ecmascript-matching-behavior) matching behavior will be used. For more information, see [this GitHub issue](https://github.com/dotnet/corefx/issues/42487).
423+
422424
A complete list of validation attributes can be found in the [System.ComponentModel.DataAnnotations](xref:System.ComponentModel.DataAnnotations) namespace.
423425

424426
### Error messages

0 commit comments

Comments
 (0)