------------------------------------------------
On Wed, 9 Jul 2003 16:38:36 -0500, "Charles K. Clarkson" <[EMAIL PROTECTED]> wrote:

> deb <[EMAIL PROTECTED]> wrote:
> : 
> : foreach my $line (@lines) {
> 
>     What's in @lines? Show us an example.
> 
> 
> : 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 looks like you are talking about email
> addresses. Since email addresses don't contain
> white space, it would all be used as a separator.
> 

That is a dangerous and incorrect assumption. E-mail addresses are wonderfully 
complex, simple e-mail addresses don't have spaces correct, but in a non-controllable 
environment this can be problematic.  If the OP is trying to parse all e-mail 
addresses from a line of text I would suggest having a look at the source code for one 
of the message parsing modules.  Specifically look at the 'From', 'To', or 'CC' header 
parsers.  If the e-mail addresses are guaranteed to be simple and controllable then 
lesser measures are acceptable, my point is more as an archiving measure for the 
thread and to prevent the assumption that never will an e-mail address in any context 
not contain white space.

> s/\s+/,/g
> 
> 
>     Unless something unexpected is in each line.
> In which case it would be awfully nice to see
> what is in @lines.
> 

Definitely.

http://danconia.org

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

Reply via email to