<?xml version="1.0" encoding="windows-1252"?>
<node id="659035" title="Re: How to get the required names" created="2007-12-26 06:53:39" updated="2007-12-26 01:53:39">
<type id="11">
note</type>
<author id="186342">
hawtin</author>
<data>
<field name="doctext">
&lt;p&gt;
As long as the &amp;quot;spacer&amp;quot; characters are not alphabetic the task is, surely, simple:&lt;/p&gt;
&lt;code&gt;
    $input_str =~ s/\W+/ /g;
    $db_str =~ s/\W+/ /g;
    if(lc($input_str) eq lc($db_str))
        ...
&lt;/code&gt;
&lt;p&gt;
Of course in the real case you will also want to remove spaces at the start and end of the string etc.&lt;/p&gt;&lt;p&gt;
In the production case this is a much more difficult problem 
since you will also want to find:&lt;/p&gt;
&lt;code&gt;
    MaggieSmith
    Magie Smythe
    M Smith
    Marge Smith
    Maggie J Smith
    etc
&lt;/code&gt;
&lt;p&gt;
In a real case good name matching is not trivial and almost always needs fuzzy matching with some combination of [1408|Soundex], known alaises and clever processing.  There is stuff about this in [287405|other nodes].&lt;/p&gt;
</field>
<field name="root_node">
658970</field>
<field name="parent_node">
658970</field>
</data>
</node>
