Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: regex die?

by ayrnieu (Beadle)
on Mar 19, 2006 at 22:24 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-25 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found