title: Javascript regex to compare two strings
body: <p>I want to compare two string using regex in javascript.</p>
  
  <p>Following is the requiremet -</p>
  
  <p>String1 = 'xyz.east.abc.com'</p>
  
  <p>String2 = 'xyz.*.abc.com'</p>
  
  <p>String3 = 'pqr.west.efg.com'</p>
  
  <p>String4 = 'pqr.*.efg.com'</p>
  
  <p>I want a regular expression by using which I should be able to compare above strings and the output should be String1 &amp; String2 are same and String3 &amp; String4 are same.</p>
  
  <p>I have tried using different combination but I was not able to figure out the correct regex to perform the task.</p>