Dear Brethren,

I am trying to concieve the regex machine that e.g an 'å' is a letter

I am processing reference lists to make all references i a common form. I have got them stored in postgres, but I need to tear apart the Author fields to make them on the same form for all references, i.e. they may be written as:
Larry Wall, Tom Christensen & Jon Orwant or
Wall, L., Christensen, T. and Orwant J. or
L. Wall, T. Christensen & J. Orwant etc.

I am using Parse::RecDescent to do this, and a part of this is an regex picking out the names which preferably should have been:
/[[upper:]][[:lower:]]+/
( presently disregarding a few problems such as double names, Mac... names etc) This works fine for some names, but then names like Ås, Lönsjö, Magnússon and so on starts to mess things up... My present name match is :
/[A-ZÆØÅ][a-zæøåäöüúáóé]+/
which does not look nice...
I have tried  use utf8; but I causes a lot of  Malformed UTF-8 character (unexpected non-continuation byte 0xd8, immediately after start byte 0xc6) in index at /opt/perl5/lib/site_perl/5.8.0/Parse/RecDescent.pm line 2979.

I have looked into  use locale; but have so far not understood what I should do to tell the regex machine to have a wider understanding of charsets than just plain ascii. Mysjkin


In reply to Charset tornment by Mysjkin

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.