Substring from Variable
Posted: Wed Jun 17, 2015 2:27 am
I have a variable that stores an IP with a subnet:
If I want another variable set to just the first part of that (just the IP, without the "/24"), is there a way to do this?
Related, but sort of separate question:
I noticed that MikroTik supports regex - is there a way to maybe use regex to specify which part of the first variable I want to assign to the second variable? Kind of like "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" - that sort of thing? Or is regex only used on MikroTik to do layer 7 domain matching?
Code: Select all
:local IPADDR "192.168.1.1/24"
Related, but sort of separate question:
I noticed that MikroTik supports regex - is there a way to maybe use regex to specify which part of the first variable I want to assign to the second variable? Kind of like "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" - that sort of thing? Or is regex only used on MikroTik to do layer 7 domain matching?