From 1b84b11cf55fb17dbb9e845a586337dc3f6ec2a1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 30 Nov 2018 10:42:35 -0800 Subject: [PATCH] Revert "fix(forms): apply unicode flag to pattern attribute when supported (#20819)" (#27375) This reverts commit 3c34b8b4f1ad32aef1b2e5213b6236c54ad93416. breaks google3 see http://cl/223526995 PR Close #27375 --- packages/forms/src/directives/validators.ts | 5 ----- packages/forms/src/validators.ts | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/forms/src/directives/validators.ts b/packages/forms/src/directives/validators.ts index d30bf483eb..210ac90432 100644 --- a/packages/forms/src/directives/validators.ts +++ b/packages/forms/src/directives/validators.ts @@ -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 * diff --git a/packages/forms/src/validators.ts b/packages/forms/src/validators.ts index d88ba19db3..aa742aeea2 100644 --- a/packages/forms/src/validators.ts +++ b/packages/forms/src/validators.ts @@ -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;