Saturday, 15 May 2010

regex - try to restrict ips via regular expression -



regex - try to restrict ips via regular expression -

trying restrict next ip range tracking:

example:

123.142.132.217-222

now thinking was:

^46.140.137.[217 - 222]

however mach number in range. cleanest way grab ending number group?

thanks

city

this pretty specific question, answer, suppose, worthwhile.

the number range 217-222 captured with

2(?:1[7-9]|2[0-2])

in ip example, don't forget escape dots

123\.142\.132\.2(?:1[7-9]|2[0-2])

regex limit

No comments:

Post a Comment