<div>&nbsp;</div>
<div>I&#39;m trying to parse a file and extract &#39;src=<a href="http://172.16.148.27">172.16.148.27</a> dst=<a href="http://10.52.10.10">10.52.10.10</a>&#39; out of each line that contains <a href="http://10.52.10.10">
10.52.10.10</a>, but get lost with writing the information and am not sure if I should&nbsp;.re at all.</div>
<div>&nbsp;</div>
<div>
<p>import re</p>
<p>infile = open(&quot;in.txt&quot;,&quot;r&quot;)<br>outfile = open(&quot;out.txt&quot;, &quot;w&quot;)</p>
<p>for line in infile:<br>&nbsp;&nbsp;&nbsp; re.match(&#39;src=*<a href="http://10.52.10.10">10.52.10.10</a>&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outfile.write(re.compile)</p>
<p><br>ofile.close()<br>wfile.close()</p></div>