node-wildcard-domain-matcher
This module is only for wildcard domain matching and may not work fine with invalid domain name characters or other usage for efficient reason.
class Matcher(opt)
- test([string]domain,[string]pattern,[bool]leadingWildCardSubdomainOnly=false)
- match([string]domain[array],patterns,[bool]leadingWildCardSubdomainOnly=false)
See the examples for usage
examples
var Matcher=; var matcher=;//patterns are cached as regexp in the object,if you don't want that usevar matcher=noCache:true); matcher;//true //leading *. will only match subdomains if leadingWildCardSubdomainOnly=truematcher;//false //return the first pattern matched in the listmatcher;//"luojia.me"