Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: regex die?

by ayrnieu (Beadle)
on Mar 19, 2006 at 22:24 UTC ( #537813=note: print w/replies, xml ) Need Help??

in reply to regex die?

my ($msg, $line) = (split /\s*at|line\s*|\.$/, $input)[0,2];

With GrandFather's caveat.

Replies are listed 'Best First'.
Re^2: regex die?
by GrandFather (Saint) on Mar 19, 2006 at 23:15 UTC

    except that the regex solution I gave returns all the text, even if it gets the split point wrong. The "split on 'at' solution" throws away anything after a second at, which is a lot worse.

    DWIM is Perl's answer to Gödel

      *shrug*, if I had a version that launched nuclear weapons when the message contained an 'at', it would still be the case than an assumption had been violated and that subsequent assumptions are then in peril.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://537813]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2022-01-22 10:52 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (62 votes). Check out past polls.