pablo wablo [pw], on Saturday, December 4, 2004 at 21:07 (-0800 (PST))
has on mind:

pw> $in =~ /\b[rR] ( ([0-9]) | ( [12][0-9] ) | ( 3[01]
pw>  ))\b/x;

pw> it works fine but I'm not satisfied with it.. (too
pw> long!)

it's nothing bad on your regexp, just you could use \d instead [0-9].
Defining your regexp as you wish - I think it will be even longer,
just see this example:

print "r$1\n" if ($in =~ /\b[Rr](\d+)(??{$1>=0&&$1<32?"":"(?!)"})\b/);

so, my solution is this:
print "r$1\n" if ($in =~ /\b[rR](\d|[12]\d|3[01])\b/);

-- 

 ...m8s, cu l8r, Brano.

["Shut up Beavis.  Don't make me kick your ass again." - Butt-Head]



-=x=-
Skontrolované antivírovým programom NOD32


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to