Hi,

I'm having trouble coming up with a regular expression for $lines in @lines
of this form:

units =               [EMAIL PROTECTED] [EMAIL PROTECTED]:[EMAIL PROTECTED]
units =               [EMAIL PROTECTED]
units =               [EMAIL PROTECTED] [EMAIL PROTECTED]


' ^units = ' is expected, all the rest is not - ie, one or more addrs, but
they must be comma separated, not space, semi-colon or colon separated.  So
far, I've got:

foreach my $line (@lines) {
   if ($line =~ /^units/)
   {
     $line =~ s/:/,/g;
     $line =~ s/;/,/g;
   }
}

The part I'm having trouble with is replacing the space(s) between the
addresses.  I don't want to touch any other whitespace.  Only the space or
spaces which might separate more than one address.  It's okay if there's a
comma and a space, but anything else needs to be replaced with a comma.  There
also doesn't have to be a space after the comma.  Only the comma is necessary.

I can't seem to find the right incantation to replace just those spaces.

HELP!  :-)

deb


-- 
                  o      _     _         _
          _o     /\_   _ \\o  (_)\__/o  (_)
        _< \_   _>(_) (_)/<_    \_| \   _|/' \/
       (_)>(_) (_)        (_)   (_)    (_)'  _\o_
               http://zapatopi.net/afdb.html







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to