在angular 2中使用正则表达式时出错,模块解析失败:严格模式下的八进制文字

时间:2019-03-11 09:43:55

标签: angular typescript

嗨,我的environment.ts文件中有一个正则表达式

export const environment = {

passwordPolicy: "^(?!.*(.)\1\1)(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}.*$"

};

但是当我进行ng测试时出现以下错误

ERROR in ./src/environments/environment.ts
Module parse failed: Octal literal in strict mode (74:30)
You may need an appropriate loader to handle this file type.
|     passwordPolicy: "^(?!.*(.)\1\1)(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}.*$"
| };
| 
 @ ./src/app/shared/services/config.service.ts 22:20-64
 @ ./src/app/shared/services/users.service.ts
 @ ./src/app/shared/services/index.ts
 @ ./src/app/users/users.component.spec.ts
 @ ./src \.spec\.ts$
 @ ./src/test.ts

请帮助我 谢谢

0 个答案:

没有答案