title: Extract first three octet from IP address
body: <p>I need to extract first three octet from a IP address(class C) and I can do it by splitting on <code>"//."</code>. But is there a way to do it using REGEX.</p>
  
  <p>Input : <code>192.168.1.1</code> Output : <code>192.168.1</code></p>