docs(forms): clarify the pattern validator behavior (#27560)

PR Close #27560
This commit is contained in:
jnizet 2018-12-09 10:18:11 +01:00 committed by Matias Niemelä
parent c5ce4e62c6
commit bba5e2632e
1 changed files with 6 additions and 2 deletions

View File

@ -273,8 +273,12 @@ export class Validators {
/**
* @description
* Validator that requires the control's value to match a regex pattern. This validator is also
* provided
* by default if you use the HTML5 `pattern` attribute.
* provided by default if you use the HTML5 `pattern` attribute.
*
* Note that if a Regexp is provided, the Regexp is used as is to test the values. On the other
* hand, if a string is passed, the `^` character is prepended and the `$` character is
* appended to the provided string (if not already present), and the resulting regular
* expression is used to test the values.
*
* @usageNotes
*