I found these two expressions in documentation:
To match subdomains of mydomain.com: (^|.*\.)mydomain\.com
To match domain and subdomains of mydomain.com: (^|.*\.)*mydomain\.com
I can't understand why those expressions mean what they say they mean. Can anybody explain both expressions please?