[Kamailio-Users] Quick REGEX to match Private IP

Uriel Rozenbaum uriel.rozenbaum at gmail.com
Tue Mar 30 16:51:12 CEST 2010


Daniel and Henning, thanks for your input. In some cases I have to compare
IPs that are not PV. In those cases I'll have to use the regex operator.

Cheers,
Uriel

On Tue, Mar 30, 2010 at 11:34 AM, Henning Westerholt <
henning.westerholt at 1und1.de> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100330/5c2c8570/attachment.htm>


More information about the sr-users mailing list