Regex to match all subdomains of a matched domains
This one should suit your needs:
https?://([a-z0-9]+[.])*sub[12]domain[.]com
- Visualization by Debuggex
- Demo on RegExr
I'm assuming that don't want the subdomains to differ simply by a number. Use this regex:
(^https:\/\/(?:[\w\-\_]+\.)+(?:subdomain1|subdomain2).com)
The single capture group is the full URL. Simply replace subdomain1 and subdomain2 with your actual subdomains.
I tested this on regex101.com