Dynamic Regex JavaScript
str.match(new RegExp(pattern1+'|'+pattern2, 'gi'));
Raviraj Solanki
str.match(new RegExp(pattern1+'|'+pattern2, 'gi'));