Just another Perl shrine | |
PerlMonks |
Re: Re: Reg Expression Questionby blakem (Monsignor) |
on Aug 31, 2001 at 12:06 UTC ( [id://109320]=note: print w/replies, xml ) | Need Help?? |
$i =~ /[0|5|8|15|20]/
But that will also match 30,15,888,150,200, etc... If you really want to use a regex for this, you'll need to anchor it like so:
Though I still think a hash is a better solution. Update: changed the square brackets to parens, thanks Hofmator... -Blake
In Section
Seekers of Perl Wisdom
|
|