Houblon has asked for the wisdom of the Perl Monks concerning the following question:

I'm parsing HTML pages and wanna grab all the email address. I'm using this matching-patter m/(\S*@\S*)/ which doing the job except that I just get one match. How do I get every one in the string.

Replies are listed 'Best First'.
Re: multi-matching
by eak (Monk) on Aug 02, 2000 at 22:27 UTC
    I think what you want is Email::Find. It will search an arbitrary piece of text and find all email addresses. --eric
Re: multi-matching
by jlistf (Monk) on Aug 02, 2000 at 22:16 UTC
    use the /g modifier.
    m/(\S*@/s*)/g
    note: for your purposes, that regular expression might work. just be aware that your test is by no means complete.

    jeff
RE: multi-matching
by infinityandbeyond (Sexton) on Aug 02, 2000 at 22:28 UTC
    Tip:
    Make sure you strip out the "NOSPAM" (and its common variants, and all other illegal characters) in the email address.
    - Infinityandbeyond, with a touch of sarcasm.
RE: multi-matching
by gryng (Hermit) on Aug 02, 2000 at 22:24 UTC
    How about changing m/(\S*@\S*)/ to s/(\S*@\S*)\s*// and then looping until you get undef? (Sorry work calls or I'd be more thorough).

    -Gryn