I am putting together some data filters for a database system. These filters are intended to check for "correctness" of the data, and perform an action if the data isn't "right". Now I use quotes on "correct" because as in life, there are always exceptions, now to a specific example. If the filter to be applied is for last names, then check to see if the first letter is capitalized, if not, use ucfirst and return the result. Now, the regex for that eludes me as I was perusing perlre, all I found was how to _convert_ to uppercase (next char, next word... etc) but I just want to check the first char not change it. Reason being, in cases such as McKenzie, FiFins, Macdonald etc... are all special cases, rather than trying to think of absolutely every special case under the sun, I choose to look for the simple way out. I'm already looking forward to a pretty obvious answer since my last few posts have gotten the same response. :-) Oh, can someone point me to telephone number storage/display methods? There must be some way of looking at a number and checking it's format validity? Thanks.

In reply to A question of logic and syntax by blackjudas

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.