[Solved] how to combine regex in jquery?


Well it depends, for instance if you want to test with an OR operator, this would be something like this :

var mergedRegex = /^(([7-9])[0-9]{9}|(0)[7-9][0-9]{9}|(\+91)[7-9][0-9]{9})$/;

If you want with an AND operator, try this instead :

var mergedRegex = /^(?=([7-9])[0-9]{9})(?=(0)[7-9][0-9]{9})(?=\+91)[7-9][0-9]{9})$/;

solved how to combine regex in jquery?