in reply to Re: Reguar expression
in thread Reguar expression

Nifty work chomzee, I like it, but considering mr. selva has not cared to provide any details into his own problems... and considering unknown issues with his unknown data... I would feel a wee bit safer with this...
$_ = "This is first sentence."; print "1st: match\n" if (/^This/i and /\.$/ and !/\bfirst\b/); $_ = "This is second sentence."; print "2nd: match\n" if (/^This/i and /\.$/ and !/\bfirst\b/);

perliff

----------------------

-with perl on my side

"If you look at the code too long, the code also looks back at you"

Replies are listed 'Best First'.
Re^3: Reguar expression
by chomzee (Beadle) on Jun 22, 2009 at 12:21 UTC

    That's true, it certainly depends on data and some details that OP didn't give (so your hints are reasonable and useful).

    And it's still three regular expressions not one, but who cares -- the code does the job well. :)