in reply to A string parsing question

Try
$line = s/([A..Z]{3})(\d+)-(\d+)-(\d+)-([A..Z])/$1$2 $1$3 $1$4 $5/g;

"We are not alone"(FZ)

Replies are listed 'Best First'.
Re: Re: A string parsing question
by suaveant (Parson) on Apr 20, 2001 at 19:23 UTC
    Only problem with that is if there are 4 or 2 counties... which I assume can happen. It's not a great regexp problem... better codewise.
                    - Ant