Revert "fix(forms): apply unicode flag to pattern attribute when supported (#20819)" (#27375)

This reverts commit 3c34b8b4f1.

breaks google3 see http://cl/223526995

PR Close #27375
This commit is contained in:
Igor Minar 2018-11-30 10:42:35 -08:00
parent 63e125986c
commit 1b84b11cf5
2 changed files with 1 additions and 10 deletions

View File

@ -379,11 +379,6 @@ export const PATTERN_VALIDATOR: any = {
* as the regex to validate Control value against. Follows pattern attribute
* semantics; i.e. regex must match entire Control value.
*
* Note: if a string type attribute value is used, the regex will be applied with the
* unicode flag on supported browsers. If a unicode-regex is passed, it might break on
* unsupported browser. In this case, the user should be responsible to handle the
* browser compatibility.
*
* @usageNotes
* ### Example
*

View File

@ -306,11 +306,7 @@ export class Validators {
if (pattern.charAt(pattern.length - 1) !== '$') regexStr += '$';
if (RegExp.prototype.hasOwnProperty('unicode')) {
regex = new RegExp(regexStr, 'u');
} else {
regex = new RegExp(regexStr);
}
regex = new RegExp(regexStr);
} else {
regexStr = pattern.toString();
regex = pattern;