Awk print lines starting with regex (IP address)
<p>Im trying to read a file for those lines which has IP address on the first column.</p>

<p>my command below does not return any value.</p>

<pre><code>cat test.csv | awk '$1 == "^[[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}]" { print $0 }'
</code></pre>

<p>The regex can capture IP address.</p>

<p>Tried the below too,</p>

<pre><code>cat test_1.csv | awk '$1~/^[[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\]/ {print $0}'
</code></pre>

<p><strong>test.csv</strong></p>

<pre><code>1.1.1.1 ipaddress gateway
2.2.2.2 ipaddress_2 firewall
www.google.com domain google
</code></pre>