Re: How do I use a constant as a regex

2004-03-12 Thread pdalec
- Original Message Follows - > > Hi, > I want to be able to be to use a regex in a couple of > places, and rather than simply copy it I would like to > setup a constant and use this. > > So I would like to be able to write something like > >use constant PRIVATE_RANGE => "/^(10\.|

How do I use a constant as a regex

2004-03-12 Thread Trevor Goddard
Hi, I want to be able to be to use a regex in a couple of places, and rather than simply copy it I would like to setup a constant and use this. So I would like to be able to write something like use constant PRIVATE_RANGE => "/^(10\.|192\.)/"; if ( $addr =~ PRIVATE_RANGE ) Any i

RE: regex question

2004-03-12 Thread Brian Raven
Wagner, David --- Senior Programmer Analyst --- WGO wrote: > > [EMAIL PROTECTED] wrote: >> I am trying to do write a search comparison between to part >> numbers >> >> $found = 1 if $string1 =~ /$string2/g; >> > If there can be reqex operators within the variable > then you need to te