title: VBScript Regular Expression to find domain name from a line of strings
body: <p>I am trying to create a regular expression to find a domain name inside a line.</p>
  
  <p>Currently, I tried this, but not working.</p>
  
  <pre><code>Set objDomainEx = CreateObject("VBScript.RegExp")
  objDomainEx.Global = True   
  objDomainEx.Pattern = "((?:[A-Z0-9-]+\.)+[A-Z]{2,4})$"
  Set matches = objDomainEx.Execute(strSearchString) 
  If matches.Count &gt; 0 Then
      For Each strMatch in matches    
         Wscript.Echo strMatch.Value
      Next
  End If
  </code></pre>
  
  <p>Whats wrong with this. My domain name looks like [www.]aaaaa.sssss.vvvvv.domain or something like that</p>