IP address handling correction in networkRange function

As I have described in comment f5b7ab5. There is a problem with filtering by IP address which has not netmask at the end.
This patch changes regular expression in the first condition and changes the way how the cidr is handled.