if you're convinced there are special characters (though I'm always a little skeptical when people tell me it's "special characters"), then you should definitely get them out of your strings, but you need to id them. Do you have binary dump program? Something that will show you the chars? (in linux I use od and look at a hexdump).

Once you know the octal values, use  s/\0(insert octal number here)//g; to strip them from the string. It may be as simple as nonuniform whitespace or tabs. In such case, strip all extra whitespace s/\s+/ /g; so that you have single spaces. Even that might be problematic with leading and trailing spaces in various places. You might consider splitting your search space and extracting only the userpref lines from each file, and storing as keys only the app.update.auto (or whatever field they are), using a regex and split.

good luck


In reply to Re: complex string matching by raybies
in thread complex string matching by freebsdboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.