[Kamailio-Users] Quick REGEX to match Private IP

Henning Westerholt henning.westerholt at 1und1.de
Tue Mar 30 16:34:56 CEST 2010


On Friday 26 March 2010, Uriel Rozenbaum wrote:
> I had a lot of errors so I'll just show the final version that works OK.
> 
>  =~ "192\.168\.([0-9]{1,3})\.([0-9]{1,3})
> 
> The only drawback is that I could pass as valid 192.168.999.999 but as
>  these IPs come from a DNS query, I assume they'll be fine.

Hi Uriel,

thank you for sharing this. As Alex mentioned, the easier (and also probably 
more faster) way is to use the src_ip construct, which 'understand' network 
ranges.

Cheers,

Henning



More information about the Users mailing list