I have searched for quite some time and can't seem to come up with a easy and problem free way of doing this, so any suggestions would be great.
I have a list of email adresses in the form
anyone@somewhere.com, gerard@spied.co.nz, mum@work.com, albert@spied.co.nz, someonelse@hotmail.com
The amount of whitespace either side of the commas is actually undertermined... it could be one none or many.
Or just in the form
robert@spied.co.nz
If there is only one address. There may be spaces here also...
Call me stupied if you will... but I would like to extract the user names from the email addresses at my domain (spied.co.nz). Note: There is always at least one with my domain.
It is late at night here and my brain is not functioning properly, to make matters worse, I have run out of coffee.
Would the best way to do this be to split it up on the commas, and then do something else wonderful with the array to get rid of the unwanted addresses?
Please help / thoughts or other better suggestions, much appreciated.
I don't expect for anyone to write the code for me, but I would love some help in getting my brain kick started.
I know that this is a simple problem, but like I said, my lack of caffeine is really getting me down.
Cheers,
Gerard
In reply to Splitting?
by Gerard
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.