get IP from part of MAC address from dhcp lease

Hi guys, i am having same device on many routers, can I somehow get IP when use only first 3 octets of mac address?

put [ip dhcp-server lease get [find mac-address=B0:6E:BF:1D:A1:2D] address]

this output me IP, but every device has different last 3 octet. Can I somehow trick this code to use whatever in last 3 but kept B0:6E:BF?

You can use regular expressions with “~” operator – https://wiki.mikrotik.com/wiki/Manual:Scripting#Other_Operators

i tried like this

put [ip dhcp-server lease get [find mac-address=B0:6E:BF~“^([0-9a-fA-F][0-9a-fA-F]:slight_smile:{5}([0-9a-fA-F][0-9a-fA-F])$” address]

but nothing.. Where i mistake?

No, “~” is a matching operator. Use it instead of “=”, not as a part of the expression - which may be as simple as “^B0:6E:BF”, meaning any string that begins with “B0:6E:BF”.

thats it! THANKS!!!

Idea behind all is to use that ip and set a queue. Do u have idea how to use that IP and set it to queue