<?xml version="1.0" encoding="windows-1252"?>
<node id="221555" title="Re: Don't Use Regular Expressions To Parse IP Addresses!" created="2002-12-20 21:24:41" updated="2005-07-27 11:52:58">
<type id="11">
note</type>
<author id="22308">
dws</author>
<data>
<field name="doctext">
&lt;i&gt;Regular expressions should not be used to parse IP addresses because IP addresses can be expressed in several forms...&lt;/i&gt;
&lt;p&gt;
"Yes, but..."
&lt;p&gt;
There are plenty of situations, such as parsing server logfiles, where four-part IP addresses are a given. In these cases, using a regex is just fine.
&lt;p&gt;
The only case I've actually run across in practice where using a regex isn't safe is when parsing URLs where some spammer has obscured an IP address by using a non-standard forms.
&lt;p&gt;

</field>
<field name="root_node">
221512</field>
<field name="parent_node">
221512</field>
</data>
</node>
