I have 2 regex strings in javascript and I need to concat them into 1 regex. I saw somewhere this could be done using |
example:
passwordRegex:RegExp = '(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&^])[A-Za-z\\d$@$!%*#?&^]{8,}';
hasFourConsecutiveRegex:RegExp = '(.)\\1\\1\\1';
combinedRegex:RegExp = new RegExp(this.passwordRegex.source + ' | ' + this.hasFourConsecutiveRegex.source );
is this how its done?