Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Regex being stupid

by boftx (Deacon)
on Sep 19, 2013 at 07:07 UTC ( #1054786=note: print w/replies, xml ) Need Help??

in reply to Regex being stupid

I'm really too tired to take a crack at this (being awake only because of a roll-out that happened at 00:00) but if it can be guaranteed that the potential email address will always be the first element before a whitespace in a give input line then you might try this:

my ($email,$foo) = split(/\s/,$text,2);

You could then use any number of tools to see if $email is actually a potentially reasonable representation of an email address.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054786]
[Corion]: ... I'm treating the incoming value sets as bags... Maybe I'll just put the burden on the user, at least in the first attempt at a full API. generate( headers => [{ 'Content-Type' => 'text/plain' }, {'Content-Type' => 'text/json' ] ), even ...
[Corion]: ... if that is cumbersome for the caller to specify. On the other hand, maybe there isn't that big a need for permuting the header values

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2017-01-17 08:27 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (152 votes). Check out past polls.