-
Notifications
You must be signed in to change notification settings - Fork 27.1k
string and RegExp are not logically consistent #47802
Copy link
Copy link
Closed as not planned
Labels
Milestone
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
No
Description
angular/packages/forms/src/validators.ts
Line 534 in 0d65e1d
| export function patternValidator(pattern: string|RegExp): ValidatorFn { |
Hello~
let test1 = "\\d{2}";
let test2 = /\d{2}/; // or new RegExp(test1)
...
Validators.pattern(test1);
// !==, without ^ and $ ??? Do string and RegExp need to be consistent?
Validators.pattern(test2);
Please provide a link to a minimal reproduction of the bug
angular/packages/forms/src/validators.ts
Line 548 in 0d65e1d
| } else { |
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 14.2.6
Node: 16.14.2
Package Manager: npm 8.19.2
OS: win32 x64
Angular: 14.2.6
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.6
@angular-devkit/build-angular 14.2.6
@angular-devkit/core 14.2.6
@angular-devkit/schematics 14.2.6
@schematics/angular 14.2.6
rxjs 7.5.7
typescript 4.7.4
Anything else?
No response
Reactions are currently unavailable