http://www.perlmonks.org?node_id=180962


in reply to Can this be parsed ?

Hmmm yeah... I should have given some more information:

Names CAN have embeded spaces, and I THINK that the unknown
field always starts with  [^A-Z] ...

One case where my solution will not work is a name without
spaces, no prependition (God, I`m starting to like that word :),
and no Unknown field... But I expect there to be more...

I tried your code, dws, but it does not seem to work
(probably because I hadn`t set the prequisitories (sp?)
straight)...

And hossman, We gave up on the poetry magnets for choosing
last names, it`s now based on quantum mechanics, but if I
were to explain to you, I`d have to... well.. let`s not go
there :))

GreetZ!,

print "profeth still\n" if /bird|devil/;

Replies are listed 'Best First'.
Re: Re: Can this be parsed ?
by hossman (Prior) on Jul 11, 2002 at 08:11 UTC
    Names CAN have embeded spaces, and I THINK that the unknown field always starts with [^A-Z] ...

    Hmm, unless you're certain about that [^A-Z] thing, it sounds like you're screwed.

    There's no clear way to parse records that don't contain a "prependition" because you can never be sure where the name ends, consider the most simple example...

    A B

    There are two totally valid parsings for this.