[TriLUG] pattern matching in hosts.allow

matt at noway2.thruhere.net matt at noway2.thruhere.net
Tue Jan 8 10:25:29 EST 2013


> I would like to match a range of ip's (111.222.333.113  to
> 111.222.333.126).
> I would just list them, but I need these same 113-126 on 12 different
> networks).
I am not an expert in regex, but it looks to me like you could do this
with two expressions.  One would be to match 111.222.333.11 followed by a
3 through 9, such as '111.222.333.11[3-9]' and one for a .12 followed by a
0 through 6 like '111.222.333.12[0-6]'.  You could also combine this into
an or statement, such as '(111.222.333.1)(1[3-9])|(2[0-6])'





More information about the TriLUG mailing list