UNPKG

peseljs

Version:
14 lines (12 loc) 994 B
// @dynamic export class RegexpConst { private static readonly values: {[key: string]: RegExp} = { PESEL: /^((00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)((([02468][13578]|[13579][02])(0[1-9]|[12][0-9]|3[01]))|(([02468]2)(0[1-9]|[12][0-9]))|(([02468][469]|[13579]1))(0[1-9]|[12][0-9]|3[0]))\d{5})|((00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)((([02468][13578]|[13579][02])(0[1-9]|[12][0-9]|3[01]))|(([02468]2)(0[1-9]|[12][0-9]))|(([02468][469]|[13579]1))(0[1-9]|[12][0-9]|3[0]))\d{5})|(((?!00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)\d{2})((([02468][13578]|[13579][02])(0[1-9]|[12][0-9]|3[01]))|(([02468]2)(0[1-9]|[12][0-8]))|(([02468][469]|[13579]1))(0[1-9]|[12][0-9]|3[0]))\d{5})$/m, NIP: /^\d{10}$/m, REGON_OLD: /^\d{9}$/m, REGON_NEW: /^\d{14}$/m, }; public static getFor(type: string): RegExp { return this.values[type]; } }