Class regex?

Jason Gerfen jason.gerfen at gmail.com
Thu Aug 19 13:31:34 UTC 2010


Thanks. I appreciate the information on this as well as better practices.

On Wed, Aug 18, 2010 at 12:53 PM, Simon Hobson <dhcp1 at thehobsons.co.uk>wrote:

> Jason Gerfen wrote:
>
>> Anyone why this class regex wouldn't match hardware addresses like these?
>>
>> match if binary-to-ascii (16,8,":",substring(hardware,0,8)) =
>> "1:0:24:7E:09";
>>
>> 00:24:7E:09:38:25
>> 00:24:7E:09:38:3D
>> 00:24:7E:09:37:F3
>>
>
> Mixing string and binary values. Hardware is only 7 bytes long for
> ethernet, and you are asking for 8 bytes !
>
> I think you'd be better with :
> match if substring(hardware,0,5) = 1:0:24:7E:09 ;
>
> Ie, do a binary compare instead of converting to text and then comparing.
> And select a length that can actually match the value you provide.
>
> --
> Simon Hobson
>
> Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
> author Gladys Hobson. Novels - poetry - short stories - ideal as
> Christmas stocking fillers. Some available as e-books.
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>



-- 
Jason Gerfen
jason.gerfen at gmail.com

~ tomorrow ain't promised so we live for today
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20100819/dbf14002/attachment.html>


More information about the dhcp-users mailing list