Mysjkin has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Charset tornment
by zentara (Cardinal) on Jan 27, 2003 at 14:44 UTC | |
|
Re: Charset tornment
by FamousLongAgo (Friar) on Jan 27, 2003 at 14:02 UTC | |
|
Re: Charset tornment
by diotalevi (Canon) on Jan 27, 2003 at 14:52 UTC | |
|
Re: Charset tornment
by mattr (Curate) on Jan 27, 2003 at 15:57 UTC | |
by Mysjkin (Initiate) on Jan 28, 2003 at 07:08 UTC | |
by mattr (Curate) on Jan 28, 2003 at 14:52 UTC |