I need to verify if given URL matches my domain mask.
Example: I want to allow only domains which satisfy this \"pseudo-mask\":
https://*.domain.com
you can use
"http://a.domain.com".indexOf("domain.com")
this will return -1 if the requested string is not in the text.
since you can don't want '.' after 'domain.com'
you can can use
"http://a.domain.com".indexOf("domain.com.")
and check whether it is -1 or not