Динамическая режима JavaScript
str.match(new RegExp(pattern1+'|'+pattern2, 'gi'));
Raviraj Solanki
str.match(new RegExp(pattern1+'|'+pattern2, 'gi'));