This question has been asked on here before and given an array of good answers, mainly: Access-Control-Allow-Origin Multiple Origin Domains?
However there seems to be a
If you need to allow a origin which contains a specific word "example" you may use the following configuration in your apache vhost.
SetEnvIf Origin "^((?:https?:\/\/)?(?:[^@\n]+@)?(?:www.)?.example?.*)" REFERER=$0
Header always set Access-Control-Allow-Origin %{REFERER}e env=REFERER
This will satisfy some of the following Origin conditions:
http://abc.bcd.example.com
https://www.example.in
http://abcdexample.com
many more
You may tweak the above regex as per your requirement.